Rust by Example
A few observations knowing nothing about Rust until I read this, perhaps someone can shed some light on these:THE BAD:* keywords like "let" are extra work for the programmer because the compiler can infer them automatically.* I’m not a fan of printf()-style parameters, because they break ordering (remarkably, php does this best with its “.” and “$” notations).* Mandatory curly brackets are also more work, although they (could) prevent subtle bugs later.* I’m not a fan of the generics syntax, borrowed from templates in c++ (I prefer the something like the “auto” style more, shifting work to the compiler).* Forcing the programmer to manually place values on the heap with “~” is annoying, when other languages can automatically optimize such things.* It seems that move semantics distinguish between objects and primitives, instead of everything being an object?* Borrow is confusing to me, because I would probably make an immutable object passed to a function as mutable create a copy (but maybe it avoids subtle bugs).* Lifetimes completely confuse me, as it seems like they would be handled by garbage collection?* I don’t have a problem with the “static” keyword, except that wouldn’t global immutable variables be static anyway?* I might have gone with traits (interfaces) everywhere instead of distinguishing them from structs, because that seems to be the direction the world is going, to avoid inheritance problems.* I’m not sure I would have distinguished closures from functions with special syntax (although maybe it prevents subtle bugs later).* #[bench] seems a little weird (putting profiling calls in the code), although I do find myself wanting this constantly, so if they conditionally compile they could be handy.THE GOOD:* Real preemptive threads it seems (as opposed to Go’s goroutines which are cooperative threads/coroutines).* UTF-8, non null-terminated strings are good (I wonder how they handle character boundaries though, especially in languages besides English).* Some argument could be made that borrowing c++ concepts makes Rust more approachable.