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.
Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
11–20 of 147 posts
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#12I 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 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
#13rewriting {PROGRAM} in rust is so fetch.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#14I 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.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#15Slopware?
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#16I 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.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#17I 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).
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
#18Earlier 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.
Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#19Re: Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
#20I used to like rust, but I feel like I’m being Pavlovian-conditioned to recoil at its mention now.