this post was submitted on 03 Jan 2024
352 points (96.8% liked)

Technology

58061 readers
31 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 1 year ago
MODERATORS
 

Enter Maestro, a unix-like monolithic kernel that aims to be compatible with Linux in order to ensure wide compatibility. Interestingly, it is written in Rust. It includes Solfége, a boot system and daemon manager, maestro-utils, which is a collection of system utility commands, and blimp, a package manager. According to Luc, it’s creator, the following third-party software has been tested and is working on the OS: musl (C standard library), bash, Some GNU coreutils commands such as ls, cat, mkdir, rm, rmdir, uname, whoami, etc… neofetch (a patched version, since the original neofetch does not know about the OS). If you want to test it out, fire up a VM with at least 1 GB of ram.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 13 points 8 months ago (1 children)

I do realize that the compiler is being annoying for my own good, you're preaching to the choir here. I've pestered about Rust being so unforgiving before, thought I was smarter than the compiler and realized the compiler was right, and been amazed.

In the grand scheme of things, though, I still think that this is slowing down adoption: trying the language is hard. Outside of the context of paid work which probably doesn't use Rust, when you're trying the language to work on small projects on which the 5x-50x figure probably doesn't hold true because the project is too small, the safety benefits aren't tangible, and writing the equivalent C++ will probably feel simpler.

To go back to the proficiency of the Rust programmers: you are entirely correct, I don't think Rust programmers have a God-given hard work ethic that other programmers don't.

Respectfully, though, I disagree with your statement that it's something about the language that makes programmers THAT many times more prolific, but I can't think of a solid explanation why at the moment.

[–] [email protected] 16 points 8 months ago

I've had the privilege of switching from C++ to Rust almost completely in my professional work. I can tell you in no uncertain terms, the language itself makes an enormous difference.

When I was doing highly concurrent multi-threaded programming in C++, I would sometimes have to waste entire weeks hunting down subtle data race bugs, despite the fact that I have a solid understanding of concurrency and multithreading. In some cases the bugs would originate in third party libraries that I was using, even though those libraries came from credible sources like Microsoft, Google, and GNU.

Switching to Rust, those bugs are gone. By the time my code compiles there's at 95% chance that it will work exactly the way it's intended to without any debugging. The remaining 5% is silly little logic accidents like saying if condition { ... } when I meant to say if !condition { ... } and those bugs are trivially caught by writing a few simple unit tests (and Rust also makes it easier to write unit tests than any other language I know of).

When I see my colleagues struggle with debugging problems in their JavaScript, Python, or C++ code, almost every time it turns out to be something that would've been trivially caught by the Rust compiler.

By no means does using Rust guarantee that your code will be completely bug free. But the language alone gets you so close to that goal that it hardly takes any special effort beyond compiling to get all the way there.

I think this is a huge reason that the ecosystem grows as quickly as it does: it's so easy to write code that you can feel confident enough about to publish for anyone to use that many people go ahead and do that, and others feel confident using the work of others because the compiler does so much to ensure quality. It creates a virtuous cycle where people can develop faster by taking advantage of other people's efforts and then release their own effort back into the community.