Picked up The Rust Programming Language book today. Really haven't looked at the language before. Chapter 1 starts strong with easy installation, a package manager, build system, and a familiar C-like syntax. #rustlang
-
Show this thread
-
Ch 2. More nice pkg management, console input is a bit verbose. Immutable default for variables is interesting, probably good but too soon to tell. Looking forward to seeing more interesting pattern matching. Not sure I like shadowing variables.
#rustlang.1 reply 0 retweets 0 likesShow this thread -
Ch 3 goes over variable shadowing again, which I'm still not comfortable with, 0o prefix for octal is nice compared to C because it allows decimal literals with leading zeros. I get that a f32 suffix is consistent but I do prefer 1.5f to 1.5f32
#rustlang1 reply 0 retweets 0 likesShow this thread -
Good: fixed-sized array on the stack. Bad: pay for index validation on every array element access. First major thing I'm not happy with but maybe there's some overhead mitigation coming later.
#rustlang2 replies 0 retweets 0 likesShow this thread -
Replying to @EscJaeger
The compiler will elide checks when it can prove they’re not needed, and you can help give it info with assert statements too at times
1 reply 0 retweets 1 like
Anyway, that’s all I’ve got for now! Thanks for this thread, seriously, it’s very good to see how people react the first time! Always happy to answer questions too
-
-
Replying to @rustlang
Thanks! The responses from everyone have been super helpful.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.