Live data from Hacker News

Linux 0.11 rewritten in idiomatic Rust, boots in QEMU

github.com

11–20 of 147 posts

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

#11
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?

More LoC means easier to quantify the impact when telling a story. The actual code quality may be lower but that’s the schmuck’s problem that comes after once promo is acquired.

I’ve never worked with Silicon Valley people before now, and now I get why so many projects are abandoned and rewritten when they could just use open source. The whole culture is promo driven.

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

#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 count.

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

#14
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?

More LoC means easier to quantify the impact when telling a story. The actual code quality may be lower but that’s the schmuck’s problem that comes after once promo is acquired.

Or, as others have already noted, it's only about 15k and the repo includes tools and test programs.

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

#16
post #10
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?

According to this breakdown: https://ghloc.vercel.app/Poseidon-fan/linux-0.11-rs?branch=m... It's about 15k lines of code for the kernel and the rest is various utilities, libraries and programs that can run on the kernel.

Also, after a quick look at a few files, the rust version appears to be much more commented. Not sure if that makes up the extra several thousand lines, but surely counts accounts for some of that.

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

#17
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).

Verbosity compared to C?

Only in extra syntax constructs.

But Rust can absolutely do the same thing as C in fewer lines, especially when comparing each's standard features like string support.

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

#18
post #16
post #10

Earlier quoted context omitted.

According to this breakdown: https://ghloc.vercel.app/Poseidon-fan/linux-0.11-rs?branch=m... It's about 15k lines of code for the kernel and the rest is various utilities, libraries and programs that can run on the kernel.

Also, after a quick look at a few files, the rust version appears to be much more commented. Not sure if that makes up the extra several thousand lines, but surely counts accounts for some of that.

SLOC should omit comments no?
Post reply on HN