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.
-
Show 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 -
"blocks of code evaluate the the last expression in them" lots of shenanigans seem to stem from this rule. The omission of a semicolon on the last line in a block changes the meaning drastically; that's going to take some getting used to.
#rustlang1 reply 0 retweets 1 likeShow this thread -
Okay it implies you can avoid the runtime checks on element access by using a for each-like construct at least for simple iteration of the whole collection. That's at least a start.
#rustlang1 reply 0 retweets 0 likesShow this thread -
Ch 4 looks to be about memory management. Discussing stack vs heap, no GC and RAII front and center, looking good.
#rustlang1 reply 0 retweets 0 likesShow this thread -
Move assignment / pass-by-move by default for non-trivial types, explicit clone() operation for a copy. Looks to be a destructive move with a compiler error if you use a moved-from object.
#rustlang1 reply 0 retweets 0 likesShow this thread -
Ran a few experiments. It's interesting what is and isn't allowed to compile with Rust move semantics. Here we can clearly see we won't ever actually move from s but still an error.pic.twitter.com/JrsRAtgkbP
2 replies 0 retweets 1 likeShow this thread -
Replying to @EscJaeger
Do you want comments on your comments? (And thanks for this thread!)
1 reply 0 retweets 0 likes -
Replying to @rustlang
Sure! I expect my initial impressions are wrong or incomplete. Comments on my comments should just help me learn faster.
1 reply 0 retweets 0 likes
Cool! I’ll reply more later.
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.