I used to like rust, but I feel like I’m being Pavlovian-conditioned to recoil at its mention now.
Can you elaborate on what causes that reaction specifically?
Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
111–120 of 147 posts
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#112I just compared this Rust implementation against the original C sources. Some ~50k SLOC (Rust) compared to maybe ~8-12k SLOC of C (depending on if you count headers). Why is the Rust implementation so much more complex and onerous?
The post title describes this as 'idiomatic', but I have a feeling that actual Rust programmers might not agree on that.
This adds a ton of noise, and breaks up the flow of the 'happy path'.
I can reasonably expect what the C code will do, however with Rust, most code runs in 3 layers of nested lambdas, so I have no idea what's going without inspecting the definiton.
This also means that while Linux 0.11 could be compiled with optimizations disabled, and get decent performance, Rust relies on complex compiler transforms to generate OK code.
To be fair, these issues are not unique to Rust, as (for example) C++ isn't exactly better in this regard, but imo Rust could be a lot more pleasant to read or write for reason that have nothing to do with memory safety or borrow checking.
One of my opinions, is that 'smart' compilers often create long and implicit chains of reasoning that must be followed, making the code very hard to navigate without either an IDE, or having to run it straight up.
Complex type inference, and permissive import systems often lead to this, and these issues are not unique to Rust (and tbf, Rust dispatch is almost always static, so you don't have to deal with DI container BS)
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#113Earlier quoted context omitted.
It's pretty much the standard target for slop now, so now "in Rust" kind of implies "I just pointed Claude at it and have no idea if the result is any good, also it's an abandoned project." Tbh I think Rust is popular and mainstream enough that it doesn't matter too much. There are still plenty of great Rust projects out there.
Truly, is that Rust's fault that sloppers are targeting it? Personally I'm becoming increasingly disillusioned with current LLMs' capabilities. All those recent high profile "rewrites" turned out to be transliterations to unsafe Rust. I could rewrite anything in unsafe Rust like right now, despite being a novice in the language.
> I could rewrite anything in unsafe Rust like right now, despite being a novice in the language.
I really doubt that. Unsafe Rust is actually significantly more difficult to get right than C or C++. See e.g. https://chadaustin.me/2024/10/intrusive-linked-list-in-rust/ or https://lucumr.pocoo.org/2022/1/30/unsafe-rust/
It's not too big of a deal because in idiomatic Rust you pretty much never write unsafe code (except for FFI), but it would be nice if it was not quite so hard (or poorly defined).
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#114Earlier quoted context omitted.
This is Linux 0.11 from 1991. Someone is having fun with a side experiment that has no practical real-world implications. This stuff is supposed to be fun and we should celebrate when other people are doing fun, pointless things like this. If you're interested then ignore it and move on. There's no need to get involved or comment if a project of no consequence is uninteresting to you personally
Someone recently had a fun side experiment [1] that ended up killing a product. [1] https://bun.sh/blog/bun-in-rust
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#115Earlier quoted context omitted.
why rewrite if you can check for and fix bugs? If you are thinking of AI fixing bugs is less expensive
Memory bugs are unknown unknowns that AI may or may not catch. There's net-present-value in switching to a language where certain types of memory bugs are impossible.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#116Earlier quoted context omitted.
If the readme is anything to go by, this doesn't look like it was written by hand. Codex if I were to guess. I wonder the coding agent "improved" the code. The readme hints at the prompt: > It keeps the original system's semantics — what it does — while rethinking how it's expressed: stronger types, clearer module boundaries, idiomatic abstractions everywhere. "idiomatic abstractions" would certainly bloat the line c…
If that's the case, I don't really get the purpose of this. It's presumably not a useful system for day to day computing. The main reason I could see someone wanting to build this would be as an educational exercise, and using an LLM to do it completely fails at that.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#117Earlier quoted context omitted.
Presumably, but exactly the sort of project where slopware is appropriate. Nobody is expected to use it.
No, it's exactly the sort of projects slop is not appropriate. If you're going to use this in production, at least using LLMs (maybe) allows you to deliver faster.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#118Slopware?
Presumably, but exactly the sort of project where slopware is appropriate. Nobody is expected to use it.
There's a certain ironic circularity to this comment given Torvalds' original email, describing his little project as:
> just a hobby, won't be big
(of course, I agree with you, no one is going to use a vibe-coded port of 0.11. A port of the latest kernel however....)
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#119I hate that 5 years ago I'd see a headline like this and think it was awesome, and now it's just "look at what someone's spent tokens on today"
Water, drinking water. Fsck these tokens.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#120Earlier quoted context omitted.
Someone recently had a fun side experiment [1] that ended up killing a product. [1] https://bun.sh/blog/bun-in-rust
Well you have our attention, could you explain the backstory?
The Bun team did an experiment to have an LLM transliterate the codebase to Rust and then iterate on turning it into idiomatic Rust. They were losing a lot of time dealing with memory management problems and wanted to move to a language with more memory safety built in rather than Zig’s very manual cleanup, which is challenging in a project like Bun that is dealing with running another language.
The Bun team posted a small blog post about the migration with technical details about how they’re doing it, along with some thanks to the Zig team and positive notes about Zig. The Zig language creator posted a blog post where he ranted about the Bun creator writing “slop before LLMs” and being a “stinky manager” according to “juicy grapes” he heard through the grapevine and numerous other attacks. It was an emotionally charged response to one of the language’s flagship projects leaving for another language.
This split the community, or at least became divisive for a lot of people who have no interest in Bun but view the fight as a proxy for some other battle like hating LLMs or Rust.
It didn’t actually kill the project. The team was acquired by Anthropic and it (the Rust version) is being used in their products, so it’s actually running everywhere and doing more than ever. There was a poll on some subreddit that showed only 30% of people were going to keep using it after the rewrite and people keep holding this up as evidence that the project is dead.