Live data from Hacker News

Linux 0.11 rewritten in idiomatic Rust, boots in QEMU

github.com

81–90 of 147 posts

Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU

#82
post #56
post #12

Earlier 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....

RedHat used to have a poster of the linux source code. Because some early version did fit a large sheet of paper.

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

#83
I'm wondering if anyone's attempting to revitalise the old Minix. Minix started out an educational software, from which, Torvalds admitted, he drew inspiration. Since then, they had higher ambitions. And now, from the last I heard, it has evolved into neither here nor there.

Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU

#84
post #12
post #4

I 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…

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

#85
post #8
post #4

I 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).

Rust is not a very verbose language. I translated (without AI) a medium sized program I'd written from Python to Rust and it was 10% longer. Hardly worth mentioning.

Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU

#86
post #57
post #26

Earlier 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.

It's ok to abbreviate things that are a) standardised, and b) used extremely frequently. Keywords are the best case here. Standard library functions are often ok (e.g. I wouldn't say renaming `memcpy` to `memory_copy` gains you much).

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

#87
post #64
post #19

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?

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.

Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU

#88

Earlier 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.

except it’s not really fun.

Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU

#89
There is one thing I admire about the Rustees: they really try to change things everywhere, including at the bottom. Whether they succeed or not is secondary to that. Personally I dislike Rust syntax-wise, but the Rustees are very motivated folks. That is interesting.

Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU

#90
post #5

Slopware?

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.
Post reply on HN