We tasked Opus 4.6 using agent teams to build a C Compiler
741–750 of 787 posts
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#742If I, a human, read the source code of $THING and then later implement my own version, that's not a "clean-room" re-implementation. The whole point of "clean-room" is that no single person has access to both the original code and the new code. (That way, you can legally prove that no copyright infringement took place.) But when an AI does it, now it counts? Opus is trained on the source code of Clang, GCC, TCC, etc.…
At one point there were issues with LLMs regurgitating licensed code verbatim. I have no doubt that Claude could parrot a large portion of GCC given correct prompting.
Being able to memorize the various C compiler implementations, alongside the sum of human knowledge, is an incredible feat. However, this is in a distinctly different domain to what a human does when writing a clean-room compiler implementation in the absence of near perfect recall of all C compiler implementations. The way that Claude solved this is probably something a human can't do, the way a human would solve this is definitely something Claude can't do.
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#743Earlier quoted context omitted.
The assembler seems like nearly the easiest part. Slurp arch manuals and knock it out, it’s fixed and complete.
I am surprised by the number of comments that say the assembler is trivial - it is admittedly perhaps simpler than some other parts of the compiler chain, but it’s not trivial. What you are doing is kinda serialising a self-referential graph structure of machine code entries that reference each others addresses, but you don’t know the addresses because the (x86) instructions are variable-length, so you can’t know the…
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#744Earlier quoted context omitted.
I am surprised by the number of comments that say the assembler is trivial - it is admittedly perhaps simpler than some other parts of the compiler chain, but it’s not trivial. What you are doing is kinda serialising a self-referential graph structure of machine code entries that reference each others addresses, but you don’t know the addresses because the (x86) instructions are variable-length, so you can’t know the…
assembler is far from trivial at least for x86 where there are many possible encodings for a given instruction. emitting the most optimal encoding that does the correct thing depends on surrounding context, and you'd have to do multiple passes over the input.
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#745Earlier quoted context omitted.
This is an experiment to see the current limit of AI capabilities. The end result isn't useful, but the fact is established that in Feb 2026, you can spend $20k on AI to get a inefficient but working C complier.
> inefficient but working FWIW, an inefficient but working product is pretty much the definition of a startup MVP. People are getting hung up on the fact that it doesn't beat gcc and clang, and generalizing to the idea that such a thing can't possibly be useful. But clearly it can, and is. This builds and boots Linux. A putative MVP might launch someone's dreams. For $20k! The reflexive ludditism is kinda scary actua…
I'm not hung up on anything. Clearly the project isn't stable because it can't be modified without regression. It can be an MVP but if it needs someone to rewrite it or spend many man-months just to grok the code to add to it then its conceivable it isnt an economic win in the long run. Also, they haven't compared this to what a smaller set of agents could accomplish with the same task and thus I am still not fully sold on the economic viability of horizontally scaling agents at this time (well at least not on the task that was tested).
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#746Earlier quoted context omitted.
Is there really value being presented here? Is this codebase a stable enough base to continue developing this compiler or does it warrant a total rewrite? Honest question, it seems like the author mentioned it being at its limits. This mirrors my own experience with Opus in that it isn't that great at defining abstractions in one-shot at least. Maybe with enough loops it could converge but I haven't seen definite pro…
This is an experiment to see the current limit of AI capabilities. The end result isn't useful, but the fact is established that in Feb 2026, you can spend $20k on AI to get a inefficient but working C complier.
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#747Earlier quoted context omitted.
> it's probably good enough to use, yea. Not for general purpose use, only for demo. > that reasonably working software of equivalent complexity is within reach for $20k to solve But if this can't come close to replacing GCC and can't be modified without introducing bugs then it hasn't proven this yet. I learned some new hacks from the paper and that's great and all but from my experiencing of trying to harness even…
> Not for general purpose use, only for demo. What does that mean, though? I mean, it's already meeting a very high quality bar by booting at all and passing those tests. No, it doesn't beat existing solutions on all the checkboxes, but that's not what the demo is about. The point being demonstrated is that if you need a "custom compiler" or something similar for your own new, greenfield requirement , you can have it…
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#748Earlier quoted context omitted.
> > It cost $20,000 > I'm curious - do you have ANY idea what it costs to have humans write 100,000 lines of code??? I'll bite - I can write you an unoptimised C compiler that emits assembly for $20k, and it won't be 100k lines of code (maybe 15k, the last time I did this?). It won't take me a week, though. I think this project is a good frame of reference and matches my experience - vibing with AI is sometimes more…
> I can write you an unoptimised C compiler that emits assembly for $20k You may be willing to sell your work at that price, but that’s not the market rate, to put it very mildly. Even 10 times that would be seriously lowballing in the realm of contract work, regardless of whether it’s “optimised” or not (most software isn’t).
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#749Earlier quoted context omitted.
Hey! I built a Lego technic car once 20 years ago. I am fully confident that I can build an actual road worthy electric vehicle. It's just a couple of edge cases and a bit bigger right? /s
That's really helpful, actually, as you may be able to give me some other ideas for projects. So, things you don't think I or my coursemates could do include writing a C compiler that builds a Linux kernel. What else do you think we couldn't do? I ask because there are various projects I'll probably get to at some point. Things on that list include (a) writing an OS microkernel and some of the other components of an…
Amiga OS is basically a microkernel and that was built 40 years ago. There are also many other examples, like Minix. Do I think most people could build a full microkernel based mini Unix? No. But they could get “something” working that would qualify as an OS.
On the other hand, there are not many C compilers that build Linux. There are many implementations of C compilers, however. The goal of “build Linux” is much more specific.
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#750Earlier quoted context omitted.
> you can have it at pretty-clearly-near-shippable quality in two weeks for $20k. if you spend months writing a tight spec, tests and have a better version of the compiler around to use when everything else fails.
> if you spend months writing a tight spec, tests and have a better version of the compiler around to use when everything else fails. Doesn't matter because your competitors will have beaten you to market. That's just a simple Darwinian point, no AI magic needed. No one doubts that things will be different in the coming Claudepocalypse, and new ideas about quality and process will need to happen to manage it. But sti…
It's hard to separate the bullshit from reality when the hype is just turned to the max everywhere you turn. It feels like I'm in some elaborate psy-op where my experiences with these tools are just an order of magnitude lower than the hype and I can't even express those thoughts without having "luddite" patch attached to me. And if you read between the lines of what Karpathy wrote in his famous "anxiety" post, it kind of echoes my point. Its "an alien technology and we can't yield it right" yada yada. Which is an odd way to say "sometimes this thing works magically but a lot of the time its total shit so you aren't as productive as you would like".