Remix.run Logo
lrvick 4 days ago

I have been working on a sub 1500 line rust init system for over a week. Hundreds of prompts. All with a local LLM running on my own GPUs because I expect to build with total sovereignty but also zero dependencies, no libc, no alloc, no std, and a test suite that proves the 20 implemented raw syscalls all use the right values by comparing against Linux kernel sources. This would be the only privileged code in my operating system so I must have absolute confidence it is perfect.

It would be too annoying for a human to ever write code to standards this high, and would have taken me months to write by hand, but with the help of AI I was able to get it done and built in a way I can easily review and reason about.

I have a memory safe baremetal tiny linux init now built to my exact requirements.

AI can help experienced engineers write better code in less time.

minitech 4 days ago | parent | next [-]

I don’t even disagree that “AI can help experienced engineers write better code in less time”, but “It would be too annoying for a human to ever write code to standards this high” when the standards are “zero dependencies, no libc, no alloc, no std, and [correctness]” and the project is <1500 lines of Rust implementing 20 syscalls is a little much. All software ever written before 2023 was written by humans, remember?

lrvick 4 days ago | parent [-]

Of course. The humans that could have written this -eventually- certainly exist but they could not have collaborated with me to get me these results on my exact schedule in a week for the few dollars of pay I spent on electricity.

That is the real difference.

couchand 4 days ago | parent [-]

And they never will, with that attitude.

lrvick 4 days ago | parent [-]

It would be an irresponsible waste of limited time and budget for a human to write this which is probably why it did not exist before.

I wrote the first version by hand in C, and then rust.

The LLM was able to rewrite it with no dependencies implementing the low level system calls and test suites that would be a nightmare to do by hand.

The best use of human time for something like this is code review.

gblargg 4 days ago | parent | next [-]

If your input is LLM-generated code, it's like taking snippets from Stack Overflow. You understand it fully and then make it yours. As long as you're hand-crafting the result, you grasp how it works.

shadowgovt 4 days ago | parent | prev [-]

This is an aspect of LLMs that probably shouldn't be understated.

I'm working on a validation tool with a coworker right now. We are meat-proxying it into existence, using less than two exchanges per day of his LLM validator and my LLM authoring engine (we could consolidate, but he's got some context I don't have and it would take more than zero engineering effort to ship it to me when PR messages through GitHub are a good-enough channel).

If not for the LLM, the tool wouldn't exist at all because we can't justify dedicating much of any engineering time to building it. But LLMs drive the engineering cost very close to zero, enabling the authorship of code that would never find engineering cycles otherwise.

nicebyte 4 days ago | parent | prev | next [-]

> It would be too annoying for a human to ever write code to standards this high,

These are standards of a normal university operating systems course (assuming a university worth its salt anyway). Ridiculous to present it as some kind of feat that was "impossible" or even that rare.

lrvick 4 days ago | parent [-]

Sure, a very smart and patient human could write this by hand in a long enough time horizon and unlimited budget. I should have said impossible in any realistic amount of time any responsible sponsor or employer would pay for.

nicebyte 4 days ago | parent [-]

I'm sorry, this is simply not true.

this https://codeberg.org/lrvick/nit/src/branch/main/src/system/r...

is textbook definition of boilerplate. you need to be patient to cross-reference syscall tables but certainly not smart.

Again, students learning about operating systems do similar things as a normal part of their education process.

I'm not saying LLMs wouldn't help with this (in fact, this is the type of thing that becomes pretty much a no-op with them) but the notion that this is "impossible by any realistic standards" is risible, and if you have actually contributed to the kernel like you say, you should know better.

lrvick 4 days ago | parent [-]

Rather than patiently referencing syscall tables by hand which is error prone and hard to review as a human, the LLM wrote tests to actually compare each of these to the kernel syscall tables to make my life a lot easier and avoid regressions or mistakes. Complex tests to write, that saves me a lot of time as a security reviewer. Can change any value and watch tests fail.

https://codeberg.org/lrvick/nit/src/branch/main/tests/kernel...

That is the point. Getting to results that satisfy security and functionality requirements in much less time.

Also, I was able to generate a bare minimal and hardened kernel config by using the LLM to write a tool to trace all kernel calls. Something that I would have normally been forced to punt on that LLMs made easy to justify.

LLMs are just as Linus Torvalds likes to say "Auto complete on steroids".

fwip 4 days ago | parent [-]

The parsing code isn't even correct, though. I'm sure it works for the current input source code, but it's a clear sign of an LLM developing by iteration, rather than actually understanding the problem and coming up with a correct solution.

How often does "this table of constants was transcribed incorrectly" even come up as a bug class? Is it worth writing a buggy C parser for a failure mode that doesn't happen? Do you expect that Linux is going to change their constant definitions out from under you?

lrvick 4 days ago | parent [-]

Correct depends on what problem one is trying to solve though the parsing can certainly be cleaned up before release. It is a working WIP.

> Do you expect that Linux is going to change their constant definitions out from under you

Unlikely but I have been surprised before. Hardcoding to pretty much any modern kernel source version forever for this narrow use case is probably fine.

The goal is about helping me and a reviewer quickly form confidence none of the magic numbers are mistaken or malicious in an automated way against the source of truth.

autuni 4 days ago | parent | prev | next [-]

I guess the point you're trying to make is that apps developed by LLMs don't need to be all that bad, but the problem here is that you can't know who does their due diligence with auditing their own code and who doesn't, and you can't expect potential users to do it either. Especially not when similar apps get published at increasingly faster rates.

LLMs also helps inexperienced engineers (or people who do not have any own software engineering skills themselves) to write horrible code in less time.

Of course you also can't trust everything human developers publish either, but the issue is amplified by LLMs.

creesch 4 days ago | parent | prev | next [-]

Cool, but I fail to see how it is relevant in the context of the article? You clearly have the knowledge, expertise and discipline to incorporate LLM in a workflow that, taking your word for it, delivers a very good result.

That makes you a) more unique than you realize b) not all that relevant in the context of the article.

a) Because a lot of people tend to lean towards use that absolutely leads to atrophying of skills and knowledge. b) well the article does explain the criteria it used fairly well and your project would not show up there. Well, also because your project isn't an android app.

lrvick 4 days ago | parent [-]

An appliance Linux distribution without dependencies is way more complex than a typical android app and there is little prior art to train on.

Android apps on the other hand, LLMs have enough training data to rapidly generate whatever you can think of with much less time required for an experienced engineer to refine it into a quality result.

I am mostly pushing back on the notion of dismissing software as low quality just because the author used LLMs.

It is frankly amazing we can point an LLM at a proprietary ad-ridden app and get to an ad-free open source and privacy respecting clone in a weekend now.

creesch 4 days ago | parent [-]

> I am mostly pushing back on the notion of dismissing software as low quality just because the author used LLMs.

Its not that hard to imagine that apps made with heavily LLM involvement suffer in quality. The article already goes into it a bit. I get the strong feeling that you are failing to approach this from anything else than your own perspective and how you use LLMs. Which, given the setup you are describing is already far from the norm.

Zooming out a bit further I think we can generally break up LLM usage in roughly two distinct ways of using LLMs. Or maybe more accurately there are two sides of a spectrum with a lot of area in between them:

1. Let LLMs do the majority of the heavy lifting and generate the output. Providing an LLM with some basic info, what you are looking for and let the LLM do most of the work for you. 2. Using LLMs as a tool external to the process where you are still doing most of the work.

The first way of using LLMs using agentic workflows, code harnesses, etc *can* produce good quality. As long as there is still a human in the mix who a) has the prerequisite knowledge to validate what the LLMs have generated b) takes their due diligence at key points in the process to actually make sure input is of high enough quality and validates the output.

You have decades of knowledge and experience you are now applying to rigidly structure how these LLMs work. Which, yes again, I believe gives you personally pretty good results, no doubt about that. But, many people do not have that experience to begin with. And even for those that do, using the first method comes with a risk that boils down to simple psychology, our minds are wired to take the easy approach wherever they can. Which turns the first way of using LLMS from a efficient way of using them to a lazy way of using them.

In my personal experience a lot of people who start using LLMs sort of drift to the lazy approach very easily. Because it is very convenient and easy to slowly hand over more thinking to an LLM. The latter I have seen happen all too often around me. An alarming increase of lazy non critical use of LLM tools by people who should know better. People who might have been a bit slower before but delivered excellent results now have started delivering trash. Code spanning dozens of line trying to solve something that should only take one line. Code that completely ignores and conventions or design paradigms put in place. Code that goes directly against security practices. Suddenly downgraded dependency versions (because the models training data doesn't include the latest version).

As I said, I see this as a spectrum and the more someone leans towards the first use case combined with "lazy usage" the more signs there will be in a repository that this is the case. The amount of commits, the release cadence and various other things. Which, again, the article also makes a case for and is again why your repository is irrelevant to the whole discussion. Why? Because your repository doesn't show these signs.

lrvick 4 days ago | parent | next [-]

Fair and nuanced. Nothing I disagree with here. I think I mostly just dislike the default hate and assumptions on everyone that uses LLMs, including often me. Some of us are using these tools thoughtfully.

LLMs help experienced engineers write quality code faster and it helps amateurs write shit code faster. Problem is there are simply way more of the latter. Even so I detest engineering being judged by the tools used, instead of the work itself being judged on its own merits because there are exceptions to every rule. I would like to teach people to use these tools responsibly, instead of sending a message that use of these tools is automatically thoughtless slop.

Like, most people I know that use Vim write much higher quality code on average than the people that use VSCode as tool preferences often reflect experience, but not always! It would still be unfair to write off someone's code sight unseen because they used VSCode as there are always exceptions to the rule.

williamse 3 days ago | parent | prev [-]

[flagged]

yjftsjthsd-h 4 days ago | parent | prev | next [-]

> This would be the only privileged code in my operating system

What does that mean? Are you building a system without a root user or something?

lrvick 4 days ago | parent [-]

Correct. It does the bare minimum system calls to boot the system, then exec to an unprivileged service manager on a read only nosuid, nodev filesystem.

I design confidential compute systems.

nickphx 4 days ago | parent | prev | next [-]

[flagged]

lrvick 4 days ago | parent [-]

https://codeberg.org/lrvick/nit

Still WIP but working.

I do not personally know a single human I could have hired who could write low level nostd nolibc noalloc rust like this, and certainly not in only a week even with hundreds of messages from me giving them detailed direction. That person may exist, but a day of their time likely costs more than the GPUs I racked up in my garage to assist with this.

I know no one wants to believe an LLM plus a human could produce more secure code than an LLM or human working alone, but as engineers we should adapt to whatever gets the best results.

Also every line is manually audited by two experienced software engineers before production.

fwip 4 days ago | parent | next [-]

Nearly any C programmer could write this.

lrvick 4 days ago | parent [-]

In a week for a few dollars of pay with a test suite that comprehensive and on my exact schedule to collaborate with me around the clock? I doubt it, but I would love to meet that person if I am wrong!

Dylan16807 4 days ago | parent [-]

This is the fastest I've ever seen goalposts move. Like, this is a completely different claim from "It would be too annoying for a human to ever write code to standards this high".

lrvick 4 days ago | parent [-]

If you take what I said out of context with zero charity, sure.

> and would have taken me months to write by hand

That implies humans can write it because I am a human and presumably other humans can too. I was making a statement about it not being possible to write it in any justifiable amount of resources.

My company would fail if I spent months on this, but a week to harden init is for sure worth it.

Dylan16807 4 days ago | parent [-]

I interpreted that as you saying in a few months you could write the code but not to those standards.

If a single person can do the full job to full standards in a few months, then the whole idea of it being too annoying for a human to ever do falls apart. That's not that expensive. Your company can't spare you, sure, but most companies could handle that price.

And even with the adjustment to being something it's easy to hire someone for, that's still ballparks away from "in a week for a few dollars". Nearly every coding project is impossible for humans by that standard.

lrvick 4 days ago | parent [-]

> Nearly every coding project is impossible for humans by that standard.

Exactly, which is why this small project, and the other dozen projects that need to be written to the same standards to make the final end result OS, would just simply not happen otherwise.

No small FOSS org can afford to spend person-years holding standards this high, which is why in practice most orgs just cut a ton of corners and pull in tons of dependencies no one will ever review and the attack surface that comes with them.

LLMs allow experienced engineers to get 10x as much done in the same time, and now that this is possible few will be willing to pay engineers to do it at 1x speeds again.

Just like once assemblers became normalized, few orgs would let people write all their assembly by hand anymore except for very small high performance sensitive portions.

Software engineering is not going away. It is just accelerating because we were able to move our attention up a layer again.

Dylan16807 4 days ago | parent [-]

> Exactly

Please use very different wording from "impossible" or "can't be done" then. It not being price-competitive is a far weaker claim.

lrvick 4 days ago | parent [-]

If you read the rest of the same line you are hung up on I literally said I could have done it in a few months, which implies I believe humans can do it, so clearly I was saying it was impossible to do in any practical amount of time or resources.

Dylan16807 4 days ago | parent [-]

I already addressed that https://news.ycombinator.com/item?id=49718446

My request for better wording stands. The context was not enough to make things clear.

uecker 4 days ago | parent | prev [-]

So it violates codeberg's policy.

lrvick 4 days ago | parent [-]

I started with a hand coded C version, then a hand coded rust version, and then an LLM refactor to remove all dependencies and add a comprehensive test suite.

Please, report me to Codeberg. It will be amusing.

I personally know a Codeberg admin that works with LLMs as a tool for things like this which are actual engineering and not vibe coding.

uecker 4 days ago | parent [-]

You should move it yourself out of respect for the community.

lrvick 4 days ago | parent [-]

No.

I actually read the terms and my community and I comply with them.

If you think I do not, you are free to report me.

> If your work fits into these cases, it is unlikely that you are affected at all:

> Projects who have an active community that cares about and maintains the software

> Projects with a significant pre-LLM history

uecker 4 days ago | parent [-]

Maybe it is tolerated.

bigstrat2003 4 days ago | parent | prev [-]

[flagged]

Varelion 4 days ago | parent | next [-]

The fact this got flagged says all you need to know about the current dev ecosystem.

lrvick 4 days ago | parent [-]

It got flagged because it is wildly wrong.

LLMs are literally solving math problems humans have struggled with for decades.

It took me a while to get through the cognitive dissonance too, but we are all going to have to do it.

legulere 4 days ago | parent | next [-]

LLMs certainly can interpolate between information found in its training set vastly faster than humans can find similar code on GitHub and stack overflow (or in math papers). It's certainly a tool that can be used when programming.

On the other hand also calculators help solve problems people have struggled with for millennia. It also doesn't mean that the end result is better than by hand. It's actually not, and that's the reason why you cannot replace programmers, because you need them to steer the LLMs for a good outcome.

And even the answer to the question, if LLMs make us more productive as programmers long-term is not really clear

lrvick 4 days ago | parent [-]

The code is not better than an imaginary human paid to work on this as long as they wanted. But said human and sponsor did not seem to exist.

If not for LLMs this type of hardening would not be possible for me to justify at a startup, and I would have had to sigh and accept the huge attack surface of systemd.

I am a security engineer and there are unlimited things to harden, so LLMs let us harden a lot more in the same very limited time.

Varelion 4 days ago | parent | prev [-]

You mean plagiarizing math problems humans have tackled for decades?

seanw444 4 days ago | parent [-]

And brute forcing solutions within well-understood constraints.

lrvick 4 days ago | parent [-]

Brute forcing faster than a human could and able to vary approaches on the fly saving humans a lot of time. Humans need only set the direction.

Lets brute force cancer. All for it.

That said, to be clear, I would never give OpenAI or Anthropic money. Their irresponsible behavior is separate from the objective capabilities of the tools, which we should seek sovereign versions of.

malfist 4 days ago | parent | prev [-]

But they have absolute confidence! They're absolutely right

lrvick 4 days ago | parent | next [-]

I can have confidence because I specced the test suite to prove the rust assembly calls matches up with the tables in the linux source code.

If any of that is wrong, then the Linux kernel is wrong the same way.

I am not even close to vibe coding. This is built to my exact spec because I actually understand this area pretty well.

I constructed a Linux distribution on my own before AI and contributed to the kernel by hand going back 20 years ago now.

fhn 4 days ago | parent | prev [-]

humans are overly confident too when they are mostly wrong