rewriting {PROGRAM} in rust is so fetch.
Stop trying to make fetch happen
Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
81–90 of 147 posts
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#82Earlier 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…
kinda sad cuz 10klines you really get into "well I can just sit there and bang at the problem by hand" territory. Sounds like a fun project....
Not sure if that's still available but it was a fun poster that I can highly recommend.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#83Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#84I 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?
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…
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#85I 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?
One of the tradeoffs of Rust is its verbosity I think (in return for which Rustaceans would say you gain explicitness).
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#86Earlier quoted context omitted.
I absolutely despise that C convention if abbreviating absolutely every single thing as much as possible. Yeah yeah, that was necessary back in the day when memory was scarce and editors were awful, but come on those days were almost half a century ago by now. Rust may be verbose, but at least you can read it without turning into a cynical greybeard subject matter expert first.
Rust does so a lot of abbreviation, though. fn, ptr, mut, etc.
The problem with many C programmers is they tend to abbreviate identifiers in code that they write, which have neither of those properties. It really slows down reading code.
It's actually even worse for hardware (SystemVerilog) developers. For some reason they have to abbreviate everything as much as humanly possible. In some cases it is acceptable (clk/rst for clock/reset) again because it's standard and common. But often you'll end up with nonsense like `dma_ctn_tlul_rsp_intg_err`. Good luck figuring that out if you don't know all the acronyms (it's DMA ConTrol Network ReSPonse INTeGrity ERRor). Obviously you don't need `dma_control_network_response_integrity_error` but there's a middle ground (probably e.g. `dma_control_resp_integrity_err`). (And sorry to pick on OpenTitan; their code isn't actually as bad for this as some of the closed source stuff I've seen.)
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#87I 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?
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.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#88Earlier quoted context omitted.
Written by AI and not nearly as impressive at all. Such a shame because I thought someone had spent real time and effort producing this. The output is commoditised and now neither important nor precious. Damn near anyone could repeat it.
To paraphrase another comment ( https://news.ycombinator.com/item?id=48900086 ), this project is fun and fun should be encouraged, as experimentation is what leads to more innovative things. The existence of this project doesn't take away from anything.