Don't get me wrong, Rust is mighty fine, and people are doing a lot of amazingly good stuff. And yet, ...
Firstly, I couldn't find book for competent programmers, the same way "The C Programming Language" teaches you each term by defining it and then showing short, concise example. I wandered through "The Rust Programming Language", but it tries too hard to hold your hand, and it's too verbose (for me, anyway). I tried also "Rust by Example", but very long listings does not make for a good examples, and commentary is reduced to a paragraph or two introducing each listing. Another book, "Learn Rust With Entirely Too Many Linked Lists" seems fine, except it doesn't cover all of the features, it's not introduction and reference book I wanted, by any stretch.
Another problem is almost total reliance on Cargo. Again, don't get me wrong, it's quite good; handles dependencies, builds without asking programmer to provide script / configuration, can do tests, documentation, can even compile and test examples in documentation(!), very impressive indeed. However, Cargo imposes it's own expectations of folder structure, and is quite rigid about it, and is geared toward small(ish) projects consisting of one module, one crate, one package. To me, conveniences are good as long as they can be overridden. Also, introductory book(s) should first explain how everything is done by-hand, and only then introduce conveniences.
Next, it seems to me that some things are still not thought through. For instance, lifetimes. These should be internal matter of a compiler, not something that programmer should ever be required to declare. For example, if rustc gets confused when trying to figure out lifetimes for a function call, it'll require you to connect lifetime from one of arguments to the lifetime of a return value. I can totally see an example when none would fit, e.g. all arguments gets owned by a function, which then drops them before instantiating return variable. It seems to me that Rust should just ensure that function arguments are all well and alive when call is made, and that return value will survive dropping of local and owned variables.
In short, Rust is build well, with good intentions, but ultimately became kindergarden-C. This is why I reverted back to original C.
No comments:
Post a Comment