Here are some of my current thoughts on Rust, as initially prompted by a thread I saw this morning asking: "What features of Rust are most appealing to you?"
My reply follows.
~~~
Originally, what drew me most to Rust I guess were (in following order)
1) Complex compiled language with momentum that was not C++
This was by far the biggest motivation, back when I was still mostly a C/Python dev. Having spent a few years working professionally as a C++11 software engineer now (having learned on the job, thanks to working during code reviews with a bunch of top-notch Modern C++ gurus), it now just looks like Haskell-lite for Modern C++ devs (which enforces all the best practices we generally do, *by default*).
2) Claims of speed + memory safety (esp around multithread type stuff - This was a big one coming from several bad Python codebases that struggled with really bad concurrency issues (i.e. random deadlocks on machines with different processor numbers than the original dev machines used), but also because Rust first started rising in prominence as I was looking into the Depsgraph stuff (which would have really benefited from being able to evaluate multiple things in parallel, to do background recalcs + caching of your scene)
3) Didn't have "cuddled else" / "caterpillar ifs" hard coded into the syntax (*cough* Go *cough*)
To this day, it still really annoys me running across code written that way. Like, really twitchy annoyed.
It's a real pity that there are a bunch of languages that hard enshrined it in their syntax (due to design decisions), and also that increasingly many examples across other C-like languages also do it. Ugh!
After using it for a while, this has became:
With cargo + Pure-Rust packages, it is a breeze to get hold of any random project, compile it to a portable executable, then run that. (Oh, and you can also expect that everything is set up as a well structured Git project with consistent folder layout too, and that the master branch is always practically in a usable state)
That is a really major selling point + ease-of-use / quality of life thing, as it means all Rust developers can rightfully expect that when loading up any random project, they don't need to do anything special / different from what they normally do.
It is also a really major benefit on Windows - as the "cmake/make + msvc path lookup" hell-games you face trying to compile C/C++ projects on there make many of them impossible to use.
Aside: I've found these days that your only solution once you start getting those problems is to have to completely throw away your environment, and reinstall both MSVC + CMake to use the latest versions, then update all such packages you're trying to compile to the latest versions too (as they only keep up to date with the latest toolsets too for the same reasons),
Caveats:
* Only applies to Pure Rust projects (which were the ones I initially stuck with). The downside though is that most Pure Rust libraries eventually end up being functionally limited in certain critical ways sometimes
* Is also increasingly untrue for most projects, since as the community at large has grown, it has also stepped away from being "Pure Rust" by default as envisaged by the original pioneers - maybe as more community imports have come and brought their grizzled pragmatism with them.
Also, cross-pollination with other ecosystems that already struggled with "chronically unpredictable unbuildability" (i.e. "Python / pip" and random projects that may demand they recompile complex binaries from source on your machine, vs just deploying a compiled binary they provide - it's again impossible to know at a glance - so you must either try OR go to troublesome lengths to audit what they're doing)
* Another unwanted trends it that the old standard philosophy of keeping their master/main branches stable/functional/compilable has also gone out the window (as more people start picking Rust up as a hobby / tinkering language, where this becomes less of a priority)
The Bad
* TBH, I still don't really like the complexity of the lifetime annotations (which get *really hairy* and ugly to type out sometimes, making the code look like crap).
* Also, increasingly I have to admit that as much as all the syntax looks like a nice + reasonable idea in isolation, the sum of all parts is a language that truthfully looks bloody ugly to look at sometimes - especially the more you try to work with it
No comments:
Post a Comment