The Rust programming language, sponsored by Mozilla, is closing in on the end of its first decade and it is picking up developers as it goes. Rust creator Graydon Hoare, reflecting (via Twitter) earlier this year on the publication of Programming Rust: Fast, Safe Systems Development by O’Reilly Media, described the birth of Rust as follows:
“I made a prototype, then my employer threw millions of dollars at it and hired dozens of researchers and programmers (and tireless interns, hi!) and a giant community of thousands of volunteers showed up and _then_ the book arrived.” (Mozilla is the employer referred to in Hoare’s tweet.)
Rust, a systems language similar in syntax to C, is currently in release 1.29 as I write this. If you are involved in web development, then the odds are good you’ve worked with Rust — and the real question becomes, “How well do you know it?”
The following 25 questions are intended to test your knowledge of various aspects of Rust from history to syntax and everything in between. The answers appear at the end of the questions. In all cases, pick the one best answer(s) to each question. Good luck!
1. Which of the following tools is used to install and manage Rust?
2. Which keyword is used to link an external crate, function, or variable?
3. Which trait is required with the use of the assert_eq! macro?
4. Which of the following specifies an explicitly absolute path?
5. Which keyword is used for the parent module of the current module?
6. Which construct should be used to define a macro?
7. Which of the following is a Rust keyword and can NOT be used as the name of a variable?
8. Per lexical convention, which of the following are used to signify the start of comments in Rust code?
C. [ /
9. Which keyword is used to denote unsafe code, functions, traits, or implementations?
10. Built around Unicode, what does U+000A mean in Rust?
A. vertical tab
B. horizontal tab
C. line feed
11. What is the range of the 128-bit unsigned integer primitive u128?
A. [1, 2^128 – 1]
B. [(0^127), 2^128 – 1]
C. [0, 2^128 – 1]
D. [-(2^127), 2^127 – 1]
12. Which type of Rust macros allow creating syntax extensions as execution of a function?
13. Which keyword is used to make a closure take ownership of all its captures?
14. Items are organized within what by a nested set of modules?
15. Using unsafe, which of the following will Rust allow you to do that you normally can not do?
A. Dereference a raw pointer
B. Read from uninitialized memory
C. Index outside the bounds of an object
D. Implement noframes
Please visit GoCertify to attempt the remaining 10 questions of this quiz.