6 ms·
Linux 0.11 rewritten in idiomatic Rust, boots in QEMU
- deleted 3mo ago[deleted]
- rvz 3mo agoNice project, with so many emojis at the start of every title of the README. Wonder who could have done that?
- fpauser 3mo ago;)
- prologic 3mo agoI 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?
- binsquare 3mo agoI don't think it's rust
- broknbottle 3mo agoMore 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.
- newtonianrules 3mo agoI’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.
- kadoban 3mo agoCoders like to code. It's in our nature. Even those who will get no benefit from it still _very_ often code their own version of things for various reasons, often bad reasons.
- 3836293648 3mo agoOr, as others have already noted, it's only about 15k and the repo includes tools and test programs.
- sudb 3mo agoOne of the tradeoffs of Rust is its verbosity I think (in return for which Rustaceans would say you gain explicitness).
- coldtea 3mo agoVerbosity 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.
- 9dev 3mo agoI 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.
- hughw 3mo agoI've found that the less real estate my eyes need to scan, the faster I understand the code, even if its more tersely expressed and requires a little decoding. Relatedly, I've come to appreciate a line of code that does the thing rather than one that calls a function whose name might express what the function does, but I might need to go find it and and read its code. That works well if your language supports a terse expression. So I prefer you tersely multiply/reduce a list rather than call a function, but some languages just aren't friendly to that and demand verbosity.
- doginasuit 3mo agoThis is why kotlin is so amazing, unusually concise and unusually clear in meaning.
- skydhash 3mo agoI kinda love it, because verbosity means you have to rely on completion and that has a negative impact on retention. And the terseness is good when you’re familiar with the code.
- dminik 3mo agoAccording to this breakdown: https://ghloc.vercel.app/Poseidon-fan/linux-0.11-rs?branch=master 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.
- josephg 3mo agoIf 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.
- rtpg 3mo agokinda 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....
- goalieca 3mo agoLinux at that point’s whole purpose was to bang at it by hand and learn something. There’s a ton of irony in having an LLM do it.
- treffer 3mo agoRedHat 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.
- pydry 3mo agoso, slop
- deleted 3mo ago[deleted]
- kelnos 3mo agoIf 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.
- icemanx 3mo agobecause of AI
- ls-a 3mo agoI like how everyone has a different theory as to why
- steveklabnik 3mo agoFor fun, I decided to take a look at a random syscall: fork. * https://github.com/yuan-xy/Linux-0.11/blob/master/kernel/fork.c https://github.com/yuan-xy/Linux-0.11/blob/master/kernel/for... * https://github.com/Poseidon-fan/linux-0.11-rs/blob/420152fdff41d62875c3de2e4f3c8f0bf23f578b/kernel/src/syscall/handler/process/fork.rs https://github.com/Poseidon-fan/linux-0.11-rs/blob/420152fdf... The Rust is slightly shorter, though it also isn't organized in exactly the same way. The code isn't that different overall, creating and copying some data structures around, as you'd expect for a fork implementation of this vintage. Maybe I got lucky, but I would expect that it's more of what other people said: this repository includes far more than the kernel.
- Aurornis 3mo agoThis repo contains a lot of extra tools and userspace programs. The majority of Rust the code in the repo is not for the Linux kernel.
- BobbyTables2 3mo agoLonger isn’t always worse. C code probably has no problem mixing and perverting int vs enum. Bitfields, structs, etc… A rust program would define an enum and also implement handling of unexpected values (or consider them errors). Structs and bitfields would be more intentionally used. Sure, Rust macros can avoid the boilerplate code, but overall line count may still increase a bit. That said, I’d blame auto-generated code here as other commenters do.
- torginus 3mo agoOnerous is a great word for this. I just checked the linked fork implementation, and basically all the lines of C code there is to the point, and does something useful. Most lines of Rust actually are there to satisfy some constraint of the language, do error handling or call into some other abstraction. 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)
- xqb64 3mo agoSlopware?
- bryanlarsen 3mo agoPresumably, but exactly the sort of project where slopware is appropriate. Nobody is expected to use it.
- computerdork 3mo agoHaha, well, maybe a couple dozen grad students creating some unusual extension to the os:)
- afdbcreid 3mo agoNo, 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.
- cestith 3mo agoWhat if 0.11 and some userland for it is just a PoC on the way to doing the same with 7? Is it worthwhile then?
- Octoth0rpe 3mo ago> 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....)
- xyst 3mo agorewriting {PROGRAM} in rust is so fetch.
- sajithdilshan 3mo agoStop trying to make fetch happen
- tialaramex 3mo agoThey actually did make fetch happen. Once upon a time it was usual in Javascript to use a thing called XMLHttpRequest which despite its name isn't actually for XML, it's just that XML was a big deal when it was created. The replacement API for making normal HTTP requests is just named fetch, and it was "new" so long ago that popular web browsers had versions like 40 rather than 150. That movie is so old it's entirely possible that it's just named "fetch" because that's a reasonable thing to call this feature and so it's a coincidence, but I do like to think that at least some people at WHATWG were quoting Mean Girls...
- sscaryterry 3mo agoWait? You guys have fetch?
- trollbridge 3mo agoThe cool kids now use axios instead of fetch (LLMs really like using axios, so all the vibe coded stuff uses it).
- larkost 3mo agoI worked for Fetch Robotics (now defunct), and there were a bunch of people (especially in management) who would constantly reference the Mean Girls "stop trying to make fetch happen" line in company-wide slideshows. A couple of times it was cute... but they took it too far in my opinion. And sadly the company was bought out, and now they too have decides to "stop trying to make Fetch happen" (yes, officially it was bought out, but not for the actual robots part).
- 3mo ago
- irishcoffee 3mo agoWhat is “un-idiomatic” rust?
- steveklabnik 3mo agoWith a project like this, I would expect that "idiomatic Rust" means "attempting to write as much safe code as is reasonably possible" rather than "translating the C to Rust directly".
- mjhay 3mo agoI used to like rust, but I feel like I’m being Pavlovian-conditioned to recoil at its mention now.
- Krutonium 3mo agoI still like it. People are having fun playing with their toy and tool. I have no problem with that.
- fsckboy 3mo agoPeople are having fun with AI coding, and I have no problem with that, but I am sick of hearing about it.
- mjhay 3mo agoI shouldn’t have been so negative. I still very much like Rust, but hearing about these AI rewrites constantly is tiresome.
- willx86 3mo agoI'd prefer reading about a rust rewrite then a saas paas CMS integration web thing on the latest framework It'll probably go nowhere, but it's cool to see people test the limits of what they can do and I can't watch without spending a penny Kinda like jackass, fascinating to watch but damn I do not want to do it
- Dylan16807 3mo agoThat's fair but you don't get that across very well with a comment that mentions Rust and doesn't mention AI.
- minimaxir 3mo agoOf all the tools in software engineering to be overpopular and overused, Rust is an instance where that is a very good thing. Atleast people aren't AI rewriting things into PHP.
- devy 3mo agoDocs full of emojis, this is another AI slop?! Tangential note: there is already a community effort[1] to rewrite GNU commandline tools into Rust and Canonical shipped the rust version of the /bin/utils in Ubuntu 26.04 Resolute Raccoon by default[2] in their "oxidizing" initiative.[3] PS: Linus Torvalds has confirmed that the existing Linux kernel will never be fully rewritten in Rust.[4] Let's see how well that statement age. [1]: https://github.com/uutils/coreutils https://github.com/uutils/coreutils [2]: https://canonical.com/blog/canonical-releases-ubuntu-26-04-lts-resolute-raccoon https://canonical.com/blog/canonical-releases-ubuntu-26-04-l... [3]: https://discourse.ubuntu.com/t/carefully-but-purposefully-oxidising-ubuntu/56995 https://discourse.ubuntu.com/t/carefully-but-purposefully-ox... [4]: https://news.ycombinator.com/item?id=41355731 https://news.ycombinator.com/item?id=41355731
- lioeters 3mo agoAs soon as Linus retires, there will be an initiative to rewrite the Linux kernel in Rust assisted by LLMs. Either that, or some company will fund a fork before that. Imagine, man pages full of emojis!
- steveklabnik 3mo agoLinus is supportive of Rust and uses LLMs. The reasons to not have a full-Rust Linux kernel are over more important, real engineering things. (Platform support being the big one.)
- broodbucket 3mo agoI 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"
- encyclopedism 3mo agoWritten 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.
- minimaxir 3mo agoTo paraphrase another comment (https://news.ycombinator.com/item?id=48900086 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.
- broodbucket 3mo agoI don't think it's wrong to do this and I'm glad it's fun for some, it's just not the same as seeing a project like this that was human authored
- dijksterhuis 3mo agoexcept it’s not really fun.
- dijksterhuis 3mo agoaddendum because that was admittedly a bit of a low effort reply. throwing a token generator at an idea is not really fun. there’s a reason show hm rules say something about not posting quick one offs (pretty sure this was originally posted as a show hn?). the fun for someone like me is in the appreciation of the effort, not the result. quirky idea? sure. but not fun
- richard_todd 3mo agoHonestly -- and I know this project is just a toy/fun experiment -- with modern AI, I think this is the correct approach to Rust-ifying projects. Just fork it and do an AI-assisted wholesale conversion, and run in parallel for a while to make sure all the regressions are found. Then you can compare to the original for benefits and drawbacks, and you get a more idiomatic code-base... instead of trying to convince longstanding projects to go into a half-rust Frankenstein model, which is what I usually see.
- drnick1 3mo agoHow does the performance compare?
- jagged-chisel 3mo agoHow do the binary sizes compare? An original Linux 0.11 kernel vs. this oxidized version.
- xedrac 3mo agoIf it's written with nostd, I'd expect them to be similar.
- jagged-chisel 3mo agoThat is indeed the expectation. But what’s the reality?
- bijowo1676 3mo agoThe ultimate boss of Rust rewrites. Very happy that LLM assisted coding unlocks these kind of projects
- globalnode 3mo agorust evangelism is some people / youth of today trying to differentiate themselves from their parents, aka heavy metal of programming. its ok, its fun. i cant read their source code but i dont need to, theres a whole world out there of c/c++/python stuff that will get the job done faster and with less hassle.
- dosisking 3mo agoRock and roll is for people with limited musical ability. Heavy metal is for people with no musical ability. Your comparison of rust to heavy metal is apt and holds up well.
- jsLavaGoat 3mo agoI wonder how long until we have an entire distro in Rust? I worked on this from the other end making drop in clones of bash, git, make, nftables, pf, iptables, and others, build on the Rust uutils. fwiw, I never liked the ergonomics of Rust when coding by hand, but it is head and shoulders my favorite vibe coding language.
- penguin_booze 3mo agoI'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.
- nineteen999 3mo agoBeginning with ME (Management Engine) firmware version 11 (found on Skylake CPUs and newer), Intel utilizes a customized version of the MINIX 3 microkernel operating system.
- lproven 3mo ago> And now, from the last I heard, it has evolved into neither here nor there. Minix 3 is a true microkernel Unix-compatible: it can run most of the NetBSD userland, for instance. It is probably the single most widely run Unix-like OS in the desktop/server world, as a copy runs in the hidden management engine inside every Intel CPU made in the last decade and a half or so. Whether the machine runs Windows, Linux, xBSD, macOS, it doesn't matter: deep inside it's running Minix. But Intel committed nothing back and never even told the OS's creator. He only found out years later: https://www.cs.vu.nl/~ast/intel/ https://www.cs.vu.nl/~ast/intel/
- shevy-java 3mo agoThere 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.
- larodi 3mo agoJust got downvoted few weeks ago for suggesting someone would soon rewrite Linux into Rust with LLMs and now he did, and this is topping HN. Are you guys the same guys who read HM every day or some other completely new folk?
- singularity2001 3mo agoThe Redox operating system is a complete rewrite of operating system concepts in Rust. Disclaimer, I worked on the Mac OS port.
- Octoth0rpe 3mo agoWhat does it mean to work on a port of redox on macos? The ability to compile it / build a disk image on macOs?
- jedisct1 3mo agoWhat a waste of tokens.
- lrvick 3mo agoSee also: Asterinas is a full rust rewrite of a minimal modern linux kernel that can run a full on modern desktop environment.
- hollerith 3mo agoInteresting. Can it run a mainstream browser?
- lproven 3mo agoNo, not yet, but it's attracting interest. I wrote about it here: https://www.theregister.com/software/2025/09/12/three-alternative-microkernels-show-devs-dont-need-linux/1428275 https://www.theregister.com/software/2025/09/12/three-altern...