4 ms·
I spent around 30 minutes reading "Rust for functional programmers" [1] to get overall perspective and then around 3 hours more reading selected chapters from "
by st1ck 8y ago
I spent around 30 minutes reading "Rust for functional programmers" [1] to get overall perspective and then around 3 hours more reading selected chapters from "The Book" [2] about borrowing, lifetimes etc.
Then I managed to write a simple program which reads a password from stdin, applies scrypt KDF to it and prints the result in hex encoding. It took me less than 2 hours. Mostly I just tried to do something, and when it didn't work, I'd find a solution for my problem on stackoverflow or r/rust. Compiler error messages were also quite helpful.
So I managed to write a useful (for me) simple CLI application in 1 day. The next day I added option processing (salt, scrypt parameters), split the code into functions etc. I didn't encounter any problem which I couldn't solve in under 1 hour. The biggest struggle was trying to return a reference to local variable from function, and it was covered in [3].
TLDR: don't try to master the language, just give it a try for a few days, writing a simple program.
[1] http://science.raphael.poss.name/rust-for-functional-programmers.html http://science.raphael.poss.name/rust-for-functional-program...
[2] https://doc.rust-lang.org/book/ https://doc.rust-lang.org/book/
[3] https://bryce.fisher-fleig.org/blog/strategies-for-returning-references-in-rust/index.html https://bryce.fisher-fleig.org/blog/strategies-for-returning...