85
The end of the kernel Rust experiment
(lwn.net)
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
Enjoy! I don't know what you used to seriously program on but I am willing to bet that the ownership paradigm that it enforces is going to feel at least moderately new to you, unless you forced yourself to code that way anyways.
Plus, as long as you're doing silly little home projects, the compiler errors are the absolute best I've ever seen. Literally just learn basic syntax, try it out, and when it does not compile, the compiler not only tells you why but also what it thinks you're trying to do and how to fix.
Absolute gem of a learning tool.
Thinking about ownership is the right way e.g. for C++ as well, so if one has coded professionally in larger systems, it should not be too alien.
One still needs to learn life time annotations. So, assuming that you know, for example, C++, it is an a bit larger hurdle than picking up Java or Go, but it is worth the time.
In many aspects, Rust is far more productive and also more beginner-friendly than C++:
I could go on... but I need to do other stuff
Thanks for the detailed answer. Preaching to the choir.
The existence of the concept of ownership in languages like C++ is why I threw "moderately" in there. I agree depending on what you take that to mean, it may or may not do some heavy lifting.
For the rest, I'd divide it into hard facts (compiler messages are absolutely undeniable, in any circumstance) and things that can definitely be true depending on your personal use cases. I'm with you on this: for the vast vast majority of tasks commonly understood as software engineering, memory safety is a concern, and a lot, if not all, of your points, are valid.
I must humbly insist that it does not fit my needs, in the sense that memory safety is of no concern to me, and that the restrictions that a compiler-enforced approach imposes make me less productive, and, subjectively, also less enjoyable because causing more friction.
That being said, you may also not consider what I'm currently doing to be software engineering, and that's totally fine. Then we'd agree entirely.
EDIT: also, there are very few languages less productive and beginner-friendly than C++ in my opinion. The proverbial bar is in hell. But you are talking to an unreasonable C++ hater.
Absolutely, I am more used to program closer to the iron mostly C. My favorite was 68000 Assembly, python is nice, but I prefer compiled languages for efficiency. Although that efficiency isn't relevant for basic tasks anymore.
The compiler error messages sound extremely cool. 👍
Ah, a fellow C coder. Never did do assembly with chips older than x86_64 basically. The only old school stuff I touched was writing an interpreter for the CHIP-8. I tried writing some CHIP-8 too, but coming from more recent paradigms, it seemed quite unwieldy to me.
I like python for quick and dirty stuff, I don't like python for being interpreted and it being not obvious what happens under the hood, memory wise, at a glance.
Seeing as you do C I'll say this. The one thing I really did not enjoy, subjectively, with Rust, is that writing "C-style loops" comes with a performance penalty because there are bound checks happening, so the idiomatic version of a loop in Rust usually involves iterators and function composition.
I am stupid. C-loops are easy for me to understand. More sophisticated stuff is hard for my little brain. I'd rather be trusted with my memory access, and be reminded of my stupidity when comes the inevitable segfault. Keeps you humble.
To me it feels like it does things I didn't ask it to. So I'm not 100% in control 😋
What? You need to make a function to make a loop? That can't be right???
Absolutely, the way C loops work is perfect. I'm not so fond of the syntax, but at least it's logical in how it works.
Ah no, there is a misunderstanding. You can write C-loops, of course, they just could involve more work under the hood because in order to enforce memory safety, there needs to be some form of bounds checking that does not happen in C. Caveat: I don't know whether that's always true, and what the subtleties are. Maybe I'm wrong about that even, but what is true is that what I am about to say, you will encounter in Rust codebases.
By function composition I meant in the mathematical sense. So, this example explains the gist of it. You may need to throw in a lambda function in there to actually do the job, yeah. I don't know what the compiler actually reduces that to though.
It's just the more functional approach that you can also see with Haskell for example. I find it harder to parse, but that may be lack of training rather than intrinsic difficult.
EDIT: pasted the wrong link to something totally irrelevant, fixed now
OK thanks for clarifying. 👍