28 ms·
We tasked Opus 4.6 using agent teams to build a C Compiler
- throwaway2027 8mo agoI think it's funny how me and I assume many others tried to do the same thing and they probably saw it being a popular query or had the same idea.
- OsrsNeedsf2P 8mo agoThis is like a working version of the Cursor blog. The evidence - it compiling the Linux kernel - is much more impressive than a browser that didn't even compile (until manually intervened)
- ben_w 8mo agoIt certainly slightly spoils what I was planning to be a fun little April Fool's joke (a daft but complete programming language). Last year's AI wasn't good enough to get me past the compiler-compiler even for the most fundamental basics, now it's all this. I'll still work on it, of course. It just won't be so surprising.
- gignico 8mo ago> To stress test it, I tasked 16 agents with writing a Rust-based C compiler, from scratch, capable of compiling the Linux kernel. Over nearly 2,000 Claude Code sessions and $20,000 in API costs, the agent team produced a 100,000-line compiler that can build Linux 6.9 on x86, ARM, and RISC-V. If you don't care about code quality, maintainability, readability, conformance to the specification, and performance of the compiler and of the compiled code, please, give me your $20,000, I'll give you your C compiler written from scratch :)
- 52-6F-62 8mo agoIf we're just writing off the billions in up front investment costs, they can just send all that my way while we're at it. No problem. Everybody happy.
- minimaxir 8mo agoThere is an entire Evaluation section that addresses that criticism (both in agreement and disagreement).
- chasd00 8mo ago> If you don't care about code quality, maintainability, readability, conformance to the specification, and performance of the compiler and of the compiled code, please, give me your $20,000, I'll give you your C compiler written from scratch :) i don't know if you could. Let's say you get a check for $20k, how long will it take you to make an equivalent performing and compliant compiler? Are you going to put your life on pause until it's done for $20k? Who's going to pay your bills when the $20k is gone after 3 months?
- pja 8mo agoThere are plenty of people on HN who could re-implement a C compiler like this in less than three months. Algorithmically compilers like this are a solved problem that has been very well documented over the last sixty or seventy years. Implementing a small compiler is a typical MSc project that you might carry out in a couple of months alongside a taught masters. This compiler is both slower than gcc even when optimising (you can’t actually turn optimisation off) & doesn’t reject type incorrect code so will happily accept illegal C code. It’s also apparently very brittle - what happens if you feed it the Linux kernel sources v. 6.10 instead of 6.9? - presumably it fails. All of the above make it simultaneously 1) really, really impressive and 2) completely useless in the real world. Great for creating discussion though!
- nnevatie 8mo ago> Who's going to pay your bills when the $20k is gone after 3 months? And who's going to maintain this turd the LLM pushed out? It's a cool one-shot sort of thing, but let's not pretend this is useful as a real compiler or something anyone would like to maintain, as a human. One could keep improving one the implementation by vibing more, but I think that's just taking you to the wrong direction of the rabbit hole.
- dmitrygr 8mo ago> The generated code is not very efficient. Even with all optimizations enabled, it outputs less efficient code than GCC with all optimizations disabled. Worse than "-O0" takes skill... So then, it produced something much worse than tcc (which is better than gcc -O0), an equivalent of which one man can produce in under two weeks. So even all those tokens and dollars did not equal one man's week of work. Except the one man might explain such arbitrary and shitty code as this: https://github.com/anthropics/claudes-c-compiler/blob/main/src/backend/arm/codegen/asm_emitter.rs#L211 https://github.com/anthropics/claudes-c-compiler/blob/main/s... why x9? who knows?! Oh god the more i look at this code the happier I get. I can already feel the contracts coming to fix LLM slop like this when any company who takes this seriously needs it maintained and cannot...
- sebzim4500 8mo agoCan one man really make a C compiler in one week that can compile linux, sqlite, etc.? Maybe I'm underestimating the simplicity of the C language, but that doesn't sound very plausible to me.
- dmitrygr 8mo agoyes, if you do not care to optimize, yes. source: done it
- Philpax 8mo agoI would love to see the commit log on this.
- dmitrygr 8mo agodid this before i knew how to git, back in college. target was ARMv5
- Philpax 8mo agoGreat. Did your compiler support three different architectures (four, if you include x86 in addition to x86-64) and compile and pass the test suite for all of this software? > Projects that compile and pass their test suites include PostgreSQL (all 237 regression tests), SQLite, QuickJS, zlib, Lua, libsodium, libpng, jq, libjpeg-turbo, mbedTLS, libuv, Redis, libffi, musl, TCC, and DOOM — all using the fully standalone assembler and linker with no external toolchain. Over 150 additional projects have also been built successfully, including FFmpeg (all 7331 FATE checkasm tests on x86-64 and AArch64), GNU coreutils, Busybox, CPython, QEMU, and LuaJIT. Writing a C compiler is not that difficult, I agree. Writing a C compiler that can compile a significant amount of real software across multiple architectures? That's significantly more non-trivial.
- deleted 8mo ago[deleted]
- deleted 8mo ago[deleted]
- sho_hn 8mo agoNothing in the post about whether the compiled kernel boots.
- chews 8mo agovideo does show it booting.
- small_model 8mo agoHow about we get the LLM's to collaborate and design a perfect programming language for LLM coding, it would be terse (less tokens) easy for pattern searches etc and very fast to build, iterate over.
- copperx 8mo agoI'm surprised by the assumption that LLMs would design such a language better than humans. I don't think that's the case.
- WarmWash 8mo agoI cannot decide if LLMs would be excellent at writing in pure binary (why waste all that context on superfluous variable names and function symbols) or be absolutely awful at writing pure binary (would get hopelessly lost without the huge diversification of tokens).
- anematode 8mo agoBinary is wayyy less information dense than normal code, so it wouldn't work well at all.
- small_model 8mo agoWe would still need the language to be human readable, but it could be very dense. They could build the ultimate std lib, that goes directly to kernels, so a call like spawn is all the tokens it needs to start a co routine for example.
- hagendaasalpine 8mo agowhat about APL et al (BQN), information dense(?)
- sjsjsbsh 8mo ago> So, while this experiment excites me, it also leaves me feeling uneasy. Building this compiler has been some of the most fun I’ve had recently, but I did not expect this to be anywhere near possible so early in 2026 What? Didn’t cursed lang do something similar like 6 or 7 months ago? These bombastic marketing tactics are getting tired.
- jsnell 8mo agoNo? That was a frontend for a toy language calling using LLVM as the backend. This is a totally self-contained compiler that's capable of compiling the Linux kernel. What's the part that you think is similar?
- ebiester 8mo agoDo you not see the difference between a toy language and a clean room implementation that can compile Linux, QEMU, Postgres, and sqlite? (No, it doesn't have the assembler and linker.) That's for $20,000.
- falloutx 8mo agopeople have built compilers for free, with $20000 you can even a couple of devs for a year in low income countries.
- whinvik 8mo agoIt's weird to see the expectation that the result should be perfect. All said and done, that its even possible is remarkable. Maybe these all go into training the next Opus or Sonnet and we start getting models that can create efficient compilers from scratch. That would be something!
- minimaxir 8mo agoA symptom of the increasing backlash against generative AI (both in creative industries and in coding) is that any flaw in the resulting product is predicate to call it AI slop, even if it's very explicitly upfront that it's an experimental demo/proof of concept and not the NEXT BIG THING being hyped by influencers. That nuance is dead even outside of social media.
- stonogo 8mo agoAI companies set that expectation when their CEOs ran around telling anyone who would listen that their product is a generational paradigm shift that will completely restructure both labor markets and human cognition itself. There is no nuance in their own PR, so why should they benefit from any when their product can't meet those expectations?
- minimaxir 8mo agoBecause it leads to poor and nonconstructive discourse that doesn't educate anyone about the implications of the tech, which is expected on social media but has annoyingly leaked to Hacker News. There's been more than enough drive-by comments from new accounts/green names even in this HN submission alone.
- krupan 8mo agoIt does lead to poor non-constructive discourse. That's why we keep calling those CEOs to task on it. Why are you not?
- trilogic 8mo agoCan it create employment? How is this making life better. I understand the achievement but come on, wouldn´t it be something to show if you created employment for 10000 people using your 20000 USD! Microsoft, OpenAI, Anthropic, XAI, all solving the wrong problems, your problems not the collective ones.
- jeffbee 8mo ago"Employment" is not intrinsically valuable. It is an emergent property of one way of thinking about economic systems.
- trilogic 8mo agoFor employment I mean "WHATEVER LEADS TO REWARD COLLECTIVE HUMANS TO SURVIVE". Call it as you wish, but I am certainly not talking about coding values.
- falcor84 8mo agoI'm struggling to even parse the syntax of "WHATEVER LEADS TO REWARD COLLECTIVE HUMANS TO SURVIVE", but assuming that you're talking about resource allocation, my answer is UBI or something similar to it. We only need to "reward" for action when the resources are scarce, but when resources are plentiful, there's no particular reason not to just give them out. I know it's "easier to imagine an end to the world than an end to capitalism", but to quote another dreamer: "Imagine all the people sharing all the world".
- swexbe 8mo agoExcept resources won't be plentiful for a long while since AI is only impacting the service sector. You can't eat a service, you can't live in one. SAAS will get very cheap though...
- falcor84 8mo agoRobotics has been advancing very quickly recently. If we solve long-term AI action planning, I don't see any limitation to making it embodied.
- 7734128 8mo agoI'm sure this is impressive, but it's probably not the best test case given how many C compilers there are out there and how they presumably have been featured in the training data. This is almost like asking me to invent a path finding algorithm when I've been thought Dijkstra's and A*.
- NitpickLawyer 8mo agoIt's a bit disappointing that people are still re-hashing the same "it's in the training data" old thing from 3 years ago. It's not like any LLM could 1for1 regurgitate millions of LoC from any training set... This is not how it works. A pertinent quote from the article (which is a really nice read, I'd recommend reading it fully at least once): > Previous Opus 4 models were barely capable of producing a functional compiler. Opus 4.5 was the first to cross a threshold that allowed it to produce a functional compiler which could pass large test suites, but it was still incapable of compiling any real large projects. My goal with Opus 4.6 was to again test the limits.
- calebhwin 8mo ago[dead]
- skydhash 8mo agoBecause for all those projects, the effective solution is to just use the existing implementation and not launder code through an LLM. We would rather see a stab at fixing CVEs or implementing features in open source projects. Like the wifi situation in FreeBSD.
- owenpalmer 8mo agoIt can compile the linux kernel, but does it boot?
- deleted 8mo ago[deleted]
- flakiness 8mo agohttps://github.com/anthropics/claudes-c-compiler/blob/main/BUILDING_LINUX.txt https://github.com/anthropics/claudes-c-compiler/blob/main/B... claims to have the first line of dmesg (which is shown using dmesg obviously.)
- hexagonsuns 8mo agohttps://youtu.be/vNeIQS9GsZ8?t=16 https://youtu.be/vNeIQS9GsZ8?t=16 They posted this video, looks like they used `qemu-system-riscv64` to test.
- NitpickLawyer 8mo agoThis is a much more reasonable take than the cursor-browser thing. A few things that make it pretty impressive: > This was a clean-room implementation (Claude did not have internet access at any point during its development); it depends only on the Rust standard library. The 100,000-line compiler can build Linux 6.9 on x86, ARM, and RISC-V. It can also compile QEMU, FFmpeg, SQlite, postgres, redis > I started by drafting what I wanted: a from-scratch optimizing compiler with no dependencies, GCC-compatible, able to compile the Linux kernel, and designed to support multiple backends. While I specified some aspects of the design (e.g., that it should have an SSA IR to enable multiple optimization passes) I did not go into any detail on how to do so. > Previous Opus 4 models were barely capable of producing a functional compiler. Opus 4.5 was the first to cross a threshold that allowed it to produce a functional compiler which could pass large test suites, but it was still incapable of compiling any real large projects. And the very open points about limitations (and hacks, as cc loves hacks): > It lacks the 16-bit x86 compiler that is necessary to boot [...] Opus was unable to implement a 16-bit x86 code generator needed to boot into 16-bit real mode. While the compiler can output correct 16-bit x86 via the 66/67 opcode prefixes, the resulting compiled output is over 60kb, far exceeding the 32k code limit enforced by Linux. Instead, Claude simply cheats here and calls out to GCC for this phase > It does not have its own assembler and linker; > Even with all optimizations enabled, it outputs less efficient code than GCC with all optimizations disabled. Ending with a very down to earth take: > The resulting compiler has nearly reached the limits of Opus’s abilities. I tried (hard!) to fix several of the above limitations but wasn’t fully successful. New features and bugfixes frequently broke existing functionality. All in all, I'd say it's a cool little experiment, impressive even with the limitations, and a good test-case as the author says "The resulting compiler has nearly reached the limits of Opus’s abilities". Yeah, that's fair, but still highly imrpessive IMO.
- modeless 8mo agoThere seem to still be a lot of people who look at results like this and evaluate them purely based on the current state. I don't know how you can look at this and not realize that it represents a huge improvement over just a few months ago, there have been continuous improvements for many years now, and there is no reason to believe progress is stopping here. If you project out just one year, even assuming progress stops after that, the implications are staggering.
- gre 8mo agoThere's a terrible bug where once it compacts then it sometimes pulls in .o or binary files and immediately fills your entire context. Then it compacts again...10m and your token budget is gone for the 5 hour period. edit: hooks that prevent it from reading binary files can't prevent this. Please fix.. :)
- falloutx 8mo agoSo it copied one of the C compilers? This was always possible but now you need to pay $1000 in API costs to Anthropic
- chucksta 8mo agoAdd a 0 and double it |Over nearly 2,000 Claude Code sessions and $20,000 in API cost
- lossyalgo 8mo agoOne more reason RAM prices will continue to go up.
- Rudybega 8mo agoIt wrote the compiler in Rust. As far as I know, there aren't any Rust based C compilers with the same capabilities. If you can find one that can compile the Linux kernel or get 99% on the GCC torture test suite, I would be quite surprised. I couldn't in a search. Maybe read the article before being so dismissive.
- hgs3 8mo ago> As far as I know, there aren't any Rust based C compilers with the same capabilities. If you trained on a neutral representation like an AST or IR, then the source language shouldn't matter. * * I'm not familiar with how Anthropic builds their models, but training this way should nullify PL differences.
- astrange 8mo agoLLMs do not learn concepts perfectly across programming languages, just as they don't learn concepts perfectly across human languages.
- falloutx 8mo agoWhy does language of the compiler matter? Its a solved problem and since other implementations are already available anyone can already transpile them to rust.
- btown 8mo ago> This was a clean-room implementation (Claude did not have internet access at any point during its development); it depends only on the Rust standard library. The 100,000-line compiler can build Linux 6.9 on x86, ARM, and RISC-V. It can also compile QEMU, FFmpeg, SQlite, postgres, redis, and has a 99% pass rate on most compiler test suites including the GCC torture test suite. It also passes the developer's ultimate litmus test: it can compile and run Doom. This is incredible! But it also speaks to the limitations of these systems: while these agentic systems can do amazing things when automatically-evaluable, robust test suites exist... you hit diminishing returns when you, as a human orchestrator of agentic systems, are making business decisions as fast as the AI can bring them to your attention. And that assumes the AI isn't just making business assumptions with the same lack of context, compounded with motivation to seem self-reliant, that a non-goal-aligned human contractor would have.
- _qua 8mo agoInteresting how the concept of a clean room implementation changes when the agent has been trained on the entire internet already
- deleted 8mo ago[deleted]
- falcor84 8mo agoTo the best of my knowledge, there's no Rust-based compiler that comes anywhere close to 99% on the GCC torture test suite, or able to compile Doom. So even if it saw the internals of GCC and a lot of other compilers, the ability to recreate this step-by-step in Rust is extremely impressive to me.
- jsheard 8mo agoThe impressiveness of converting C to Rust by any means is kind of contingent on how much unnecessary unsafe there is in the end result though.
- hrgadyx 8mo ago[flagged]
- falcor84 8mo agoThey didn't "steal" open source code any more than I stole my copy of The Odyssey.
- chvid 8mo ago100.000 lines of code for something that is literally a text book task? I guess if it only created 1.000 lines it would be easy to see where those lines came from.
- wmf 8mo agoThis has multiple backends and a long tail of C extensions that are not in the textbook.
- anematode 8mo agoA simple C89 compiler is a textbook task; a GCC-compatible compiler targeting multiple architectures that can pass 99% of the GCC torture test suite is absolutely not.
- falcor84 8mo ago> literally a text book task Generating a 99% compliant C compiler is not a textbook task in any university I've ever heard of. There's a vast difference between a toy compiler and one that can actually compile Linux and Doom. From a bit of research now, there are only three other compilers that can compile an unmodified Linux kernel: GCC, Clang/LLVM and Intel's oneAPI. I can't find any other compiler implementation that came close.
- cv5005 8mo agoThat's because you need to implement a bunch of gcc-specific behavior that linux relies on. A 100% standards compliant c23 compiler can't compile linux.
- falcor84 8mo agoOk, yes, that's true, though my understanding is that it's not the GCC is not compliant, but rather that it includes extensions beyond the standard, which is allowed by the standard, which says (in section 4. Conformance): > A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any strictly conforming program Anyway, this just makes Claude's achievement here more impressive, right?
- jcalvinowens 8mo agoHow much of this result is effectively plagiarized open source compiler code? I don't understand how this is compelling at all: obviously it can regurgitate things that are nearly identical in capability to already existing code it was explicitly trained on... It's very telling how all these examples are all "look, we made it recreate a shitter version of a thing that already exists in the training set".
- anematode 8mo agoHonestly, probably not a lot. Not that many C compilers are compatible with all of GCC's weird features, and the ones that are, I don't think are written in Rust. Hell, even clang couldn't compile the Linux kernel until ~10 years ago. This is a very impressive project.
- Philpax 8mo agoWhat Rust-based compiler is it plagiarising from?
- jcalvinowens 8mo agoBeing written in rust is meaningless IMHO. There is absolutely zero inherent value to something being written in rust. Sometimes it's the right tool for the job, sometimes it isn't.
- Philpax 8mo agoPlease don't open a bridge to the Rust flamewar from the AI flamewar :-)
- jcalvinowens 8mo agoHahaha, fair enough, but I refuse to be shy about having this opinion :)
- modeless 8mo agoIt means that it's not directly copying existing C compiler code which is overwhelmingly not written in Rust. Even if your argument is that it is plagiarizing C code and doing a direct translation to Rust, that's a pretty interesting capability for it to have.
- light_hue_1 8mo ago> This was a clean-room implementation (Claude did not have internet access at any point during its development); This is absolutely false and I wish the people doing these demonstrations were more honest. It had access to GCC! Not only that, using GCC as an oracle was critical and had to be built in by hand. Like the web browser project this shows how far you can get when you have a reference implementation, good benchmarks, and clear metrics. But that's not the real world for 99% of people, this is the easiest scenario for any ML setting.
- rvz 8mo ago> This is absolutely false and I wish the people doing these demonstrations were more honest. That's because the "testing" was not done independently. So anything can be possibly be made to be misleading. Hence: > Written by Nicholas Carlini, a researcher on our Safeguards team.
- akrauss 8mo agoI would like to see the following published: - All prompts used - The structure of the agent team (which agents / which roles) - Any other material that went into the process This would be a good source for learning, even though I'm not ready to spend 20k$ just for replicating the experiment.
- password4321 8mo agoYes unfortunately these days most are satisfied with just the sausage and no details about how it was made.
- a456463 8mo agoJust claims with nothing to back it. Steal people's work of years, and turn around be like I make it "so much better". Support this compiler for 20 years then
- fxtentacle 8mo agoYou could hire a reasonably skilled dev in India for a week for $1k —- or you could pay $20k in LLM tokens, spend 2 hours writing essays to explain what you want, and then get a buggy mess.
- Philpax 8mo agoNo human developer, not even Fabrice Bellard, could reproduce this specific result in a week. A subset of it, sure, but not everything this does.
- epolanski 8mo agoHowever it was achieved, building a such a complex project like a C compiler on a 20k $ budget in full autonomy is quite impressive. Imho some commenters focus way too much on the (many, and honestly also shared by the blog post too) cons, that they forget to be genuinely impressed by the steps forward.
- yu3zhou4 8mo agoAt this point, I genuinely don't know what to learn next to not become obsolete when another Opus version gets released
- RivieraKid 8mo agoI agree. I don't understand there are so many software engineers who are excited about this. I would only be excited if I was a founder in addition to being a software engineer.
- missingdays 8mo agoLearn to fix bugs, it's gonna be more relevant than ever
- wiseowise 8mo agoThat’s already Opus 4.7s main selling point.
- segh 8mo agoPeople skills :/
- yu3zhou4 8mo agongmi
- stephc_int13 8mo agoThey should add this to the benchmark suite, and create a custom eval for how good the resulting compiler is, as well as how maintainable the source code.
- snek_case 8mo agoThis would be an expensive benchmark to run on a regular basis, though I guess for the big AI labs it's nothing. Code quality is hard to objectively measure, however.
- ks2048 8mo agoIt's cool that you can look at the git history to see what it did. Unfortunately, I do not see any of the human written prompts (?). First 10 commits, "git log --all --pretty=format:%s --reverse | head", Initial commit: empty repo structure Lock: initial compiler scaffold task Initial compiler scaffold: full pipeline for x86-64, AArch64, RISC-V Lock: implement array subscript and lvalue assignments Implement array subscript, lvalue assignments, and short-circuit evaluation Add idea: type-aware codegen for correct sized operations Lock: type-aware codegen for correct sized operations Implement type-aware codegen for correct sized operations Lock: implement global variable support Implement global variable support across all three backends
- c-linkage 8mo agoThat's crazy to me. At this point, I don't even know if the git commit log would be useful to me as a human. Maybe it's just me, but I like to be able to do both incremental testing and integration testing as I develop. This means I would start with the lexer and parser and get them tested (separately and together) before moving on to generating and validating IR. It looks like the AI is dumping an entire compiler in one commit. I'm not even sure where I would begin to look if I were doing a bug hunt. YMMV. I've been a solo developer for too many years. Not that I avoided working on a team, but my teams have been so small that everything gets siloed pretty quickly. Maybe life is different when more than one person works on the same application.
- Havoc 8mo agoCool project, but they really could have skipped the mention of clean room. Something trained on every copyrighted thing known to mankind is the opposite of clean room
- benjiro 8mo agoHot take: If you try to reimplement something in a clean room, its a step by step process, using your own accumulated knowledge as the basis. That knowledge that you hold in your brain, all too often is code that may have copyrights on it, from the companies you worked on. Is it any different for a LLM? The fact that the LLM is trained on more data, does not change that when you work for a company, leave it, take that accumulated knowledge to a different company, you are by definition taking that knowledge (that may be copyrighted) and implementing it somewhere else. It only a issue if you copy the code directly, or do the implementation as a 1:1 copy. LLMs do not make 1:1 copies of the original. At what point is trained on copyrighted data, any different then a human trained on copyrighted data, that get reimplemented in a transformative way. The big difference is that the LLM can hold more data over more fields, vs a human, true... But if we look at specializations, this can come back to the same, no?
- cermicelli 8mo agoIf you have worked on a related copyrighted work you can't work on a clean room implementation. You will be sued. There are lots of people who have tried and found out. They weren't trillion dollar AI companies to bankroll the defense sure. But thinking about clean room and using copyrighted stuff is not even an argument that's just nonsense to try to prove something when no one asked.
- deleted 8mo ago[deleted]
- Crestwave 8mo agoClean-room design is extremely specific. Anyone who has so much as glanced at Windows source code[1] (or even ReactOS code![2]) is permanently banned from contributing to WINE. This is 100% unambiguously not clean-room unless they can somehow prove it was never trained on any C compiler code (which they can't, because it most certainly was). [1] https://gitlab.winehq.org/wine/wine/-/wikis/Developer-FAQ#who-cant-contribute-to-wine https://gitlab.winehq.org/wine/wine/-/wikis/Developer-FAQ#wh... [2] https://gitlab.winehq.org/wine/wine/-/wikis/Clean-Room-Guidelines https://gitlab.winehq.org/wine/wine/-/wikis/Clean-Room-Guide...
- 201984 8mo agohttps://github.com/anthropics/claudes-c-compiler/issues/1 https://github.com/anthropics/claudes-c-compiler/issues/1
- Philpax 8mo agoThe issue is that it's missing the include paths. The compiler itself is fine.
- krupan 8mo agoThank you. That was a long article that started with a claim that was backed up by no proof, dismissing it as not the most interesting thing they were talking about when in fact it's the baseline of the whole discussion.
- worldsavior 8mo agoAI is the future.
- Retr0id 8mo agoLooks like these users are just missing glibc-devel or equivalent?
- delusional 8mo agoNaa, it looks like it's failing to include the standard system include directories. If you take then from gcc and pass them as -I, it'll compile.
- Retr0id 8mo agoCan confirm (on aarch64 host) $ ./target/release/ccc-arm -I /usr/include/ -I /usr/local/include/ -I /usr/lib/gcc/aarch64-redhat-linux/15/include/ -o hello hello.c $ ./hello Hello from CCC!
- u8080 8mo agoSeems this non-artificial intelligence model just too limited to understand concept of include path.
- exitcode0000 8mo agoCool article, interesting to read about their challenges. I've tasked Claude with building an Ada83 compiler targeting LLVM IR - which has gotten pretty far. I am not using teams though and there is quite a bit of knowledge needed to direct it (even with the test suite).
- polskibus 8mo agoSo did the Linux compiled with this compiler worked? Does it work the same as GCC-compiled Linux (but slower due to generating non optimized code?)
- throwaway2027 8mo agoNext time can you build a Rust compiler in C? It doesn't even have to check things or have a borrow checker, as long as it reduces the compile times so it's like a fast debug iteration compiler.
- Philpax 8mo agoYou will experience very spooky behaviour if you do this, as the language is designed around those semantics. Nonetheless, mrustc exists: https://github.com/thepowersgang/mrustc https://github.com/thepowersgang/mrustc It will not be noticeably faster because most of the time isn't spent in the checks, it's spent in the codegen. The cranelift backend for rustc might help with this.
- geooff_ 8mo agoMaybe I'm naive, but I find these re-engineering complex product posts underwhelming. C Compilers exist and realistically Claudes training corpus contains a ton of C Compiler code. The task is already perfectly defined. There exists a benchmark of well-adopted codebases that can be used to prove if this is a working solution. Half the difficulty in making something is proving it works and is complete. IMO a simpler novel product that humans enjoy is 10x more impressive than rehashing a solved problem, regardless of difficulty.
- stephc_int13 8mo agoThis is a nice benchmark IMO. I would be curious to see how competitors and improved models would compare.
- NitpickLawyer 8mo agoAnd how long will it take before an open model recreates this. The "vibe" consensus before "thinking" models really took off was that open was ~6mo behind SotA. With the massive RL improvements, over the past 6 months I've thought the gap was actually increasing. This will be a nice little verifiable test going forward.
- bs7280 8mo agoI don't see this as just exercise in making a new useful thing, but benchmarking the SOTA models ability to create a massive* project on its own, with some verifiable metrics of success. I believe they were able to build FFMPEG with this rust compiler? How much would it cost to pay someone to make a C compiler in rust? A lot more than $20k * massive meaning "total context needed" >> model context window
- stephc_int13 8mo agoIt means that if you already have or a willing to build very robust test suite and the task is a complicated but already solved problem, you can get a sub-par implementation for a semi-reasonable amount of money. This is not entirely ridiculous.
- ndesaulniers 8mo agoI spent a good part of my career (nearly a decade) at Google working on getting Clang to build the linux kernel. https://clangbuiltlinux.github.io/ https://clangbuiltlinux.github.io/ This LLM did it in (checks notes): > Over nearly 2,000 Claude Code sessions and $20,000 in API costs It may build, but does it boot (was also a significant and distinct next milestone)? (Also, will it blend?). Looks like yes! > The 100,000-line compiler can build a bootable Linux 6.9 on x86, ARM, and RISC-V. The next milestone is: Is the generated code correct? The jury is still out on that one for production compilers. And then you have performance of generated code. > The generated code is not very efficient. Even with all optimizations enabled, it outputs less efficient code than GCC with all optimizations disabled. Still a really cool project!
- phillmv 8mo agoi mean… your work also went into the training set, so it's not entirely surprising that it spat a version back out!
- GaggiX 8mo agoClang is not written in Rust tho
- underdeserver 8mo agojinx
- underdeserver 8mo agoAnthropic's version is in Rust though, so at least a little different.
- rwmj 8mo agoIt's not really important in latent space / conceptually.
- 8mo ago
- itay-maman 8mo agoMy first reaction: wow, incredible. My second reaction: still incredible, but noting that a C compiler is one of the most rigorously specified pieces of software out there. The spec is precise, the expected behavior is well-defined, and test cases are unambiguous. I'm curious how well this translates to the kind of work most of us do day-to-day where requirements are fuzzy, many edge cases are discovered on the go, and what we want to build is a moving target.
- ndesaulniers 8mo ago> C compiler is one of the most rigorously specified pieces of software out there /me Laughs in "unspecified behavior."
- ori_b 8mo agoThere's undefined behavior, which is quite well specified. What do you mean by unspecified behavior? Do you have an example?
- ndesaulniers 8mo agohttps://www.open-std.org/jtc1/sc22/wg14/www/docs/n3685.pdf https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3685.pdf Read section J.1.
- irishcoffee 8mo agoUndefined is absolutely clear in the spec. Unspecified is whatever you want it to mean. I am also laughing, having never heard "unspecified" before.
- LiamPowell 8mo agoUnspecified behaviour is defined in the glossary at the start of the spec and the term "unspecified" appears over a hundred times...
- softwaredoug 8mo ago
- deleted 8mo ago[deleted]
- danfritz 8mo agoHa yes classic showcase of: 1) obvious green field project 2) well defined spec which will definitely be in the training data 3) an end result which lands you 90% from the finish Now comes the hard part, the last 10%. Still not impressed here. Since fixing issues in the end was impossible without introducing bugs I have doubts about quality I'm glad they do call it out in the end. That's fair
- woeirua 8mo agoWe went from barely able to ask these things to write a function to writes a compiler that actually kind of works in under a year. But sure, keep moving the goal posts!
- sieep 8mo agoDidn't the Anthropic CEO claim we would be replaced by this AI tech by now? Here's Anthropic moving their own goal post in real time: 2026: https://www.entrepreneur.com/business-news/ai-ceo-says-software-engineers-could-be-replaced-in-months/502087 https://www.entrepreneur.com/business-news/ai-ceo-says-softw... 2025: https://fortune.com/2025/03/13/ai-transforming-software-development-jobs-meta-ibm-anthropic/ https://fortune.com/2025/03/13/ai-transforming-software-deve... https://www.entrepreneur.com/business-news/anthropic-ceo-predicts-ai-will-take-over-coding-in-12-months/488533 https://www.entrepreneur.com/business-news/anthropic-ceo-pre...
- emp17344 8mo agoMany people are convinced that we’re all going to die next year after these things achieve sentience. Can’t wait to see the goalpost shifting when AI 2027 doesn’t pan out.
- cuechan 8mo ago> The compiler is an interesting artifact on its own [...] its funny bacause by (most) definitions, it is not an artifact: > a usually simple object (such as a tool or ornament) showing human workmanship or modification as distinguished from a natural object
- deleted 8mo ago[deleted]
- rwmj 8mo agoThe interesting thing here is what's this code worth (in money terms)? I would say it's worth only the cost of recreation, apparently $20,000, and not very much more. Perhaps you can add a bit for the time taken to prompt it. Anyone who can afford that can use the same prompt to generate another C compiler, and another one and another one. GCC and Clang are worth much much more because they are battle-tested compilers that we understand and know work, even in a multitude of corner cases, over decades. In future there's going to be lots and lots of basically worthless code, generated and regenerated over and over again. What will distinguish code that provides value? It's going to be code - however it was created, could be AI or human - that has actually been used and maintained in production for a long time, with a community or company behind it, bugs being triaged and fixed and so on.
- kingstnap 8mo agoThe code isn't worth money. This is an experiment. The knowledge that something like this is even possible is what is worth money. If you had the knowledge that a transformer could pull this off in 2022. Even with all its flawed code. You would be floored. Keep in mind that just a few years ago, the state of the art in what these LLMs could do was questions of this nature: Suppose g(x) = f−1 (x), g(0) = 5, g(4) = 7, g(3) = 2, g(7) = 9, g(9) = 6 what is f(f(f(6)))? The above is from the "sparks of AGI paper" on GPT-4, where they were floored that it could coherently reason through the 3 steps of inverting things (6 -> 9 -> 7 -> 4) while GPT 3.5 was still spitting out a nonsense argument of this form: f(f(f(6))) = f(f(g(9))) = f(f(6)) = f(g(7)) = f(9). This is from March 2023 and it was genuinely very surprising at the time that these pattern matching machines trained on next token prediction could do this. Something like a LSTM can't do anything like this at all btw, no where close. To me its very surprising that the C compiler works. It takes a ton of effort to build such a thing. I can imagine the flaws actually do get better over the next year as we push the goalposts out.
- IshKebab 8mo ago> I tried (hard!) to fix several of the above limitations but wasn’t fully successful. New features and bugfixes frequently broke existing functionality. This has been my experience of vibe coding too. Good for getting started, but you quickly reach the point where fixing one thing breaks another and you have to finish the project yourself.
- underdeserver 8mo ago> when agents started to compile the Linux kernel, they got stuck. [...] Every agent would hit the same bug, fix that bug, and then overwrite each other's changes. > [...] The fix was to use GCC as an online known-good compiler oracle to compare against. I wrote a new test harness that randomly compiled most of the kernel using GCC, and only the remaining files with Claude's C Compiler. If the kernel worked, then the problem wasn’t in Claude’s subset of the files. If it broke, then it could further refine by re-compiling some of these files with GCC. This let each agent work in parallel This is a remarkably creative solution! Nicely done.
- hmry 8mo agoIf 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. So this is not "clean-room".
- bmandale 8mo agoThat's not the only way to protect yourself from accusations of copyright infringement. I remember reading that the GNU utils were designed to be as performant as possible in order to force themselves to structure the code differently from the unix originals.
- Crestwave 8mo agoYes, but Anthropic is specifically claiming their implementation is clean-room, while GNU never made that claim AFAIK.
- rishabhaiover 8mo ago[flagged]
- hmry 8mo agoJust tired of AI companies having more rights than natural people when it comes to copyright infringement. Let us have some of the fun too!
- rishabhaiover 8mo agoI apologize for making that assumption.
- astrange 8mo agoCopyright doesn't protect ideas, it protects writing. Avoiding reading LLVM or GCC is to protect you from other kinds of IP issues, but it's not a copyright issue. The same people contribute to both projects despite their different licenses.
- storus 8mo agoNow this is fairly "easy" as there are multitude of implementations/specs all over the Internet. How about trying to design a new language that is unquestionably better/safer/faster for low-level system programming than C/Rust/Zig? ML is great in aping existing stuff but how about pushing it to invent something valuable instead?
- karmakaze 8mo agoI'm not particularly impressed that it can turn C into an SSA IR or assembly etc. The optimizations, however sophisticated is where anything impressive would be. Then again, we have lots of examples in the training set I would expect. C compilers are probably the most popular of all compilers. What would be more impressive is for it to have made a compiler for a well defined language that isn't very close to a popular language. What I am impressed by is that the task it completed had many steps and the agent didn't get lost or caught in a loop in the many sessions and time it spent doing it.
- astrange 8mo ago> What would be more impressive is for it to have made a compiler for a well defined language that isn't very close to a popular language. That doesn't seem difficult as long as you can translate it into a well-known IR. The Dragon Book for some reason spends all its time talking about frontend parsing, which does give you the impression it's impossible. I agree writing compilers isn't especially difficult, but it is a lot of work and people are scared of it. The hard part is UI - error handling and things like that.
- personjerry 8mo ago> Over nearly 2,000 Claude Code sessions and $20,000 in API costs Well there goes my weekend project plans
- degurechaff 8mo agowell, you can use jules and spend zero dollar on it. I also create similiar project like this, c11 compiler in rust using AI agent + 1 developer(https://github.com/bungcip/cendol https://github.com/bungcip/cendol). not fully automated like anthophic did, but at least i can understand what it did.
- jhallenworld 8mo agoDoes it make a conforming preprocessor?
- jwpapi 8mo agoThis is my favorite article this year. Just very insightful and honest. The learnings are worth thousands for me.
- softwaredoug 8mo agoI think we’re getting to a place where for anything with extensive verification available we’ll be “fitting” code to a task against tests like we fit an ML model to a loss function.
- lubujackson 8mo agoThis is very much a "vibe coding can build you the Great Pyramids but it can't build a cathedral" situation, as described earlier today: https://news.ycombinator.com/item?id=46898223 https://news.ycombinator.com/item?id=46898223 I know this is an impressive accomplishment and is meant to show us the future potential, but it achieves big results by throwing an insane amount of compute at the problem, brute forcing its way to functionality. $20,000 set on fire, at Claude's discounted Max pricing no less. Linear results from exponential compute is not nothing, but this certain feels like a dead end approach. The frontier should be more complexity for less compute, not more complexity from an insane amount more compute.
- Philpax 8mo ago> $20,000 in API costs I would interpret this as being at API pricing. At subscription pricing, it's probably at most 5 or 6 Max subscriptions worth.
- ajross 8mo ago> $20,000 set on fire To be fair, that's two weeks of the employer cost of a FAANG engineer's labor. And no human hacks a working compiler in two weeks. It's a lot of AI compute for a demo, sure. But $20k stunts are hardly unique. Clearly there's value being demonstrated here.
- pcloadlett3r 8mo agoIs 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 proof of that in current generation with these ambitious clickbaity projects.
- ajross 8mo agoIf it generates a booting kernel and passes the test suite at 99% it's probably good enough to use, yeah. The point isn't to replace GCC per se, it's to demonstrate that reasonably working software of equivalent complexity is within reach for $20k to solve whatever problem it is you do have.
- pshirshov 8mo agoPfft, a C compiler. Look at this: https://github.com/7mind/jopa https://github.com/7mind/jopa
- bsoles 8mo agoThe title should have said "Antropic stole GCC and other open-source compiler code to create a subpar, non-functional compiler", without attribution or compensation. Open source was never meant for thieving megacorps like them. No, I did not read the article...
- forty 8mo agoWe live a wonderful time where I can spend hours and $20000 to build a C compiler which is slow and inefficient and anyway requires an existing great compiler to even work, and then neither I nor the agent has any idea on how to make it useful :D
- sieep 8mo agoHeres $20b in VC funding. Congrats!
- davemp 8mo agoBrute forcing a problem with a perfect test oracle and a really good heuristic (how many c compilers are in the training data) is not enough to justify the hype imo. Yes this is cool. I actually have worked on a similar project with a slightly worse test oracle and would gladly never have to do that sort of work again. Just tedious unfulfilling work. Though we caught issues with both the specifications/test oracle when doing the work. Also many of the team members learned and are now SMEs for related systems. Is this evidence that knowledge work is dead or AGI is coming? Absolutely not. I think you’d be pretty ignorant with respect to the field to suggest such a thing.
- deleted 8mo ago[deleted]
- mucle6 8mo agoThis feels like the start of a paradigm shift. I need to reunderwrite what my vision of the future looks like.
- almosthere 8mo agoThis is like the 6th trending claude story today. It must be obvious that they told everyone at Anthropic to upvote and comment.
- dzaima 8mo agoClicked on the first thing I happen to be interested in - SIMD stuff - and ended up at https://github.com/anthropics/claudes-c-compiler/blob/6f1b99acb2f4ec2414592136c2009fe7713deec3/include/xmmintrin.h#L575 https://github.com/anthropics/claudes-c-compiler/blob/6f1b99..., which is a fast path incompatible with the _mm_free implementation; pretty trivial bug, not even actually SIMD or anything specialized at all. A whole lot of UB in the actual SIMD impls (who'd have expected), but that can actually be fine here if the compiler is made to not take advantage of the UB. And then there's the super-weird mix of manual loops vs inline assembly vs builtins.
- stevefan1999 8mo agoI tried writing a C compiler in Rust in the spirit of TCC, but I'm just too lazy to finish it.
- logicprog 8mo agoI will say that one thing that's extremely interesting is that everyone laughed at and made fun of Steve Yegge when he released Gas Town, which centered exactly around this idea — of having more than a dozen agents working on a project simultaneously with some generalized agents focusing on implementing features while other are more specialized and tasked with second-order tasks, where you just independently run them in a loop from an orchestrator until they've finished the project where they all work on work trees and, you know, satisfy merch conflicts and stuff as a coordination mechanism — but it's starting to kind of look like he was right. He really was aiming for where the puck was headed. First we got cursor with the fast render browser, then we got Kimi K2.5 releasing with — from everything I can tell — actually very innovative and new specific RL techniques for orchestrating agent swarms. And now we have this, Anthropic themselves doing a Gas Town-style agent swarm model of development. It's beginning to look like he absolutely did know where the puck was headed before it got there. Now, whether we should actually be building software in this fashion or even headed in this direction at all is a completely separate question. And I would tend strongly towards no. Not until at least we have very strong, yet easy to use concise and low effort formal verification, deterministic simulation testing, property-based testing, integration testing, etc; and even then, we'll end up pair programming those formal specifications and batteries of tests with AI agents. Not writing them ourselves, since that's inefficient, nor turning them over to agent swarms, since they are very important. And if we turn them over to swarms, we'd end up with an infinite regress problem. And ultimately, that's just programming at a higher level at that point. So I would argue we should never predominantly develop in this way. But still, there is prescience in Gastown apparently, and that's interesting.
- jgarzik 8mo agoAlready done, months ago, with better taste: https://github.com/rustcoreutils/posixutils-rs https://github.com/rustcoreutils/posixutils-rs
- andrewshawcare 8mo agoIt used the best tests it could find for existing compilers. This is effectively steering Claude to a well-defined solution. Hard to find fully specified problems like this in the wild. I think this is more a testament to small, well-written tests than it is agent teams. I imagine you could do the same thing with any frontier model and a single agent in a linear flow. I don’t know why people use parallel agents and increase accidental complexity. Isn’t one agent fast enough? Why lose accuracy over +- one week to write a compiler? > Write extremely high-quality tests > Claude will work autonomously to solve whatever problem I give it. So it’s important that the task verifier is nearly perfect, otherwise Claude will solve the wrong problem. Improving the testing harness required finding high-quality compiler test suites, writing verifiers and build scripts for open-source software packages, and watching for mistakes Claude was making, then designing new tests as I identified those failure modes. > For example, near the end of the project, Claude started to frequently break existing functionality each time it implemented a new feature. To address this, I built a continuous integration pipeline and implemented stricter enforcement that allowed Claude to better test its work so that new commits can’t break existing code.
- GalaxyNova 8mo ago> Hard to find fully specified problems like this in the wild. This is such a big and obvious cope. This is obviously a very real problem in the wild and there are many, many others like it. Probably most problems are like this honestly or can be made to be like this.
- anematode 8mo agoImpressive, my sarcasm/bait detector almost failed me.
- tantalor 8mo agoWhy didn't Claude realize on its own that it needed a continuous integration pipeline? Far to much human intervention here.
- krzat 8mo agoYou know what else is well specified? LLM improving on itself.
- deleted 8mo ago[deleted]
- keeptrying 8mo agoThis is more an example of code distribution rather than intelligence. If Claude had NOT been trained on compiler code, it would NOT have been able to build a compiler. Definitely signals the end of software IP or at least in its present form.
- stkdump 8mo agoIn a weird sense Open Source won
- keeptrying 8mo agoYep - its an interesting angle to look at it. Or rather OpenSource might have just saved the world!
- sreekanth850 8mo agoMuch better than cursor's browser fiasco.
- casey2 8mo agoInteresting that they are still going with a testing strategy despite the wasted time. I think in the long run model checking and proofs are more scale-able. I guess it makes as agents can generate tests, since you are taking this route I'd like to see agents that act as a users, that can only access docs, textbooks, user forums and builds.
- anupamchugh 8mo agoThis is a very early research prototype with no other inter-agent communication methods or high-level goal management processes." The lock file approach (current_tasks/parse_if_statement.txt) prevents two agents from claiming the same task, but it can't prevent convergent wasted work. When all 16 agents hit the same Linux kernel bug, the lock files didn't help — the problem wasn't task collision, it was that the agents couldn't see they were all solving the same downstream failure. The GCC oracle workaround was clever, but it was a human inventing a new harness mid-flight because the coordination primitive wasn't enough. Similarly, "Claude frequently broke existing functionality implementing new features" isn't a model capability problem — it's an input stability problem. Agent N builds against an interface that agent M just changed. Without gating on whether your inputs have changed since you started, you get phantom regressions
- travisgriggs 8mo agoA C Compiler seems like one of the more straightforward things to have done. Reading this gives me the same vibe as when a magician does a frequently done trick (saw someone in half, etc). I'd be more interested in letting it have a go at some some of the other "less trodden" paths of computing. Some of the things that would "wow me more": - Build a BEAM alternative, perhaps in an embedded space - Build a Smalltalk VM, perhaps in an embedded space, or in WASM These things are documented at some level, but still require a bit of original thinking to execute and pull off. That would wow me more.
- adgjlsfhk1 8mo agoif it actually compiles real C correctly, it's pretty impressive. The C standard is a total mess.
- 8-prime 8mo agoYet we have gcc and clang navigating that mess. From which Opus 4.6 was able to take inspiration.
- myduck_hacker 8mo ago[dead]
- boring-human 8mo agoPeople focused on the flaws are missing the picture. Opus wasn't even trained to be "a member of a team of engineers," it was adapted to the task by one person with a shell script loop. Specific training for this mode of operation is inevitable. And model "IQ" is increasing with every generation. If human IQ is increasing at all, it's only because the engineer pool is shrinking more at one end than the other. This is a five-alarm fire if you're a SWE and not retiring in the next couple years.
- smithcoin 8mo ago> This is a five-alarm fire if you're a SWE and not retiring in the next couple years. I’m sorry, but this is such a hype beast take. In my opinion this is equivalent to telling people not to learn to drive five years ago because of self driving from Tesla. How is that going? Every single line of code produced is a liability. This idea that you’re going to have “gas town” like agents running and building apps without humans in the loop at any point to generate liability free revenue is insane to me. Are humans infallible? Obviously not. But if you are telling me that ‘magic probability machines’ are creating safe, secure, and compliant software that has no need for engineers to participate in the output- first I’d like to see a citation and second I have a bridge to sell you.
- boring-human 8mo ago> In my opinion this is equivalent to telling people not to learn to drive five years ago because of self driving Self-driving has different economics. We're reading tea leaves, true, but it's also true that software has zero marginal cost and that $20K pays for an engineer-month in SF. > Every single line of code produced is a liability. Do you have a hard spec and rock-solid test cases? If you do, you have two options to a working prototype: 2-6 engineer-years, or $20K. The second option will greatly increase in quality and likely decrease in price over the next few years. What if the spec and the test cases are the new software? Assembly programmers used to make an argument against compiled code that's somewhat parallel to yours: every instruction is a (performance) liability. > without humans in the loop There will be humans, just fewer and fewer. The spec and test cases are AI-eligible too. > safe, secure, and compliant software I'm not sure humans' advantage here is safe, if it even exists still.
- deleted 8mo ago[deleted]
- lambda-lollipop 8mo agoapparently [hello world does not compile...](https://github.com/anthropics/claudes-c-compiler/issues/1 https://github.com/anthropics/claudes-c-compiler/issues/1)
- smy20011 8mo agoI think the good thing about it is that if you are given good specification, you are likely to get good result. Writing a C compiler is not something new, but it will be great for all the porting projects.
- tonis2 8mo agoI wish they would do llvm from scratch too
- jackdoe 8mo agohonestly i am amazed that it can do that, but I wish they use it to rewrite the claude code cli. i had to killall -9 claude 3 times yesterday
- rhubarbtree 8mo agoThey are already writing Claude with Claude - I think they said 90% of their code is written with Claude.
- jackdoe 8mo agoyes, they must be killing it hundreds of times per day, maybe its time for 'please rewrite opencode, but dont touch anything, you can only use `cp`' kind of prompt
- arkh 8mo agoMy question would be: what are the myriad other projects you tasked Opus 4.6 to build and it could not get to a point you could kinda-sorta make a post about? This kind of headline makes me think of p-hacking.
- secretsatan 8mo agoWho checks to see if it’s backdoored?
- tymonPartyLate 8mo agoI try to see this like F1 racing. Building a browser or a C compiler with agent swarms is disconnected from the reality of normal software projects. In normal projects the requirements are not full understood upfront and you learn and adapt and change as you make progress. But the innovations from professional racing result in better cars for everyone. We'll probably get better dev tools and better coding agents thanks to those experiments.
- Decabytes 8mo agoFor me the real test will be building a c++ compiler
- andrepd 8mo agoThis chatbot has several C compilers in its training data. How is this possibly a useful benchmark for anything? LLMs routinely output code verbatim or modulo trivial changes as their own (very useful for license-laundering too).
- miki123211 8mo agoWhat I find to be the most impressive part here is that it wrote the compiler without reference to the C specification and without architecture manuals at hand.
- cesaref 8mo agoMost of the effort when writing a compiler is handling incorrect code, and reporting sensible error messages. Compiling known good code is a great start though.
- socalgal2 8mo agoThinking about the this, while it’s a cool achievement, how useful is it really? It realizes on the fact there is a large comprehensive set of tests and a large number of available projects that can function as tests. That situation is extremely uncommon for most development
- psychoslave 8mo ago>The fix was to use GCC as an online known-good compiler oracle to compare against. >This was a clean-room implementation (Claude did not have internet access at any point during its development); it depends only on the Rust standard library. How does one re-conciliate both of this statements? Sure one can fetch all of gnu.org in local, and a model which already scrapped the whole internet somehow already integrated it in its weights, didn’t it? The worldwide median household income (as of 2013 data from Gallup) was approximately $9,733 per year (in PPP, current international dollars). This means that $20,000 per year is more than double the global median income. A median Luxembourg citizen earns $20,000 in about 5 to 6 months of work, a Burundi one would on median need 42.5 months, that is 3.5 years. https://worldpopulationreview.com/country-rankings/median-income-by-country https://worldpopulationreview.com/country-rankings/median-in...
- a456463 8mo agoThank you!!! All these resources being spent on centralizing and claiming to outsource and reduce human thinking to nothing.
- nottorp 8mo agoApparently there's a reproducibility crisis in science. Are Anthropic's claims reproducible?
- subzel0 8mo agoOne thing this article proved is that the Dead Internet Theory is real. Look at all these Claudy comments!
- ur-whale 8mo ago> We tasked Opus 4.6 using agent teams to build a C Compiler So, essentially to build something for which many, many examples already exist on the web, and which is likely baked into its training set somehow ... mmmyeah.
- erfburfl 8mo ago[dead]
- jaccola 8mo agoI think this is cool! But by some definition my "Ctrl", "C", and "V" keys can build a C compiler... Obviously being facetious but my point being: I find it impossible to judge how impressed I should be by these model achievements since they don't show how they perform on a range of out-of-distribution tasks.
- rco8786 8mo ago> Claude will work autonomously to solve whatever problem I give it. So it’s important that the task verifier is nearly perfect, otherwise Claude will solve the wrong problem. I think this is the fundamental thing here with AI. You can spin up infinite agents that can all do....stuff. But how do you keep them from doing the wrong stuff? Is writing an airtight spec and test harness easier or less time consuming than just keeping a human in the loop and verifying and redirecting as the agents work? It all still comes back to context management. Very cool demonstration of the tech though.
- sigbottle 8mo agoEven with all the caveats: - trained on all the GCC/clang source - pulled down a kernel branch, presumably with extensive tests in source - used GCC as an oracle I certainly wouldn't be able to do this. I flip flop man.
- polyglotfacto 8mo agoSo I do think one can get value from coding agents, but that value is out of proportion compared to the investments made by the AI labs, so now they're pushing this kind of stuff which I find to be a borderline scam. Let me explain why: > the resulting compiled output is over 60kb, far exceeding the 32k code limit enforced by Linux Seems like a failure to me. > I tried (hard!) to fix several of the above limitations but wasn’t fully successful. New features and bugfixes frequently broke existing functionality. This has code smell written all over it. ---- Conclusion: this cost 20k to build, not taking into account the money spent on training the model. How much would you pay for this software? Zero. The reality is that LLM are up there with SQL and ROR(or above) in terms of changing how people write software and interact with data. That's a big deal, but not enough to support trillion dollar valuations. So you get things like this project, which are just about driving a certain narrative.
- conception 8mo agoI don’t understand. This badly done work wasn’t possible at all six months ago. In six more months it will be better. It’s not a mostly static technology for the last twenty plus years.
- polyglotfacto 8mo agoPoint is: it doesn't matter if agents can do it faster and cheaper than a team of humans: it's slop. It's like writing a novel in a week that no one wants to read. If in six months you can do it in an hour, there is still zero value. Agents are useful but very limited tools: I treat them a little machines that can translate high-level instructions into detailed code, but where I still need to review the output to make sure they understood what I meant; that's it. Zero autonomy; parallelism just means I can't keep up with the output and quality goes down. I think the point of this project, like the fastrender slop thing, is to push the parallel agent narrative and have the financial markets believe this will create a lot more demand for inference on these models in the short term. Example of someone falling for it: https://x.com/DKThomp/status/2019484169915572452 https://x.com/DKThomp/status/2019484169915572452
- hexo 8mo agoI really love how they waste energy for stuff like this. Even better, all that nonsense talk we constantly kept hearing about energy crysis just a few years ago...
- a456463 8mo agoYup. All the tech hype bros are like "but my compiler"... Nobody was paying me to write a compiler, the meaning of "clean room" keeps changing, that they had to spend $20k (on the surface), not include the energy costs, the hardware costs, the time of assembly, etc. If you only paid that much money to a person and group of people. It is the hype bros wet dream to extract all value out of people and somehow get rich. Who cares if humanity suffers, look what I built for myself by enslaving people and wasting earth resources. Every single AI fetishist in this thread is responsible for it.
- marklsnyder 8mo agoVery cool, but I can't help but wonder how this translates to similarly complex projects where innate knowledge about the domain hasn't been embedded in the LLM via training data. There's a wealth of open source compiler code and related research papers that have been fed to the LLM. It seems like that would advantage the LLM significantly.
- phendrenad2 8mo agoNot just open-source compilers, but books on compiler design, which have proliferated because every CS professor wants to take a crack at the problem.
- mimd 8mo agoI'm annoyed at the cost statement, as that's the sleight of hand. "$20000" at current pricing. Add some orders of magnitude to the costs and you'll get your true price you'll have to pay when the VC money starts to wear off. 2nd, this is ignoring the dev time that he/others put in over multiple iterations of this project (opus 4, opus 4.5) and all the other work to create the scaffolding for it, and all the millions/tens of millions of dollars of hand written test suits (linux kernel, gcc, doom, sqlite, etc) he got to use to guide the process. So add some more cost on top of that orders of magnitude increase and the dev time is probably a couple months/years more than "2 weeks". And this is just working off the puff pieces statements, and not even diving into the code to see it's limits/origins, etc. I also don't see the scaffold in the repo, as that's where the effort is. But still it's not surprising, from my own experience, given a rigorously definable problem, enough effort, grunt work, and massaging, you can get stuff out of the current models.
- mshockwave 8mo agohow did it do regalloc before instruction selection? How do you select the correct register class without knowing which instruction you're gonna use?
- QuantumNoodle 8mo agoAs cool as the result is, this article is quite tone death to the fact that they asked a statistical model to "build" what was already in its training dataset... And not to mention with troves of forum data discussing bugs and best practices.
- _lunix 8mo agoThe comments at [1] are a bit _too_ trollish for me, but they _do_ showcase that this compiler is far too lenient on what it accepts to the point where I'd hesitate to call it ... a C compiler (This [2] comment in particular is pretty damning). Still, an impressive achievement nonetheless, but there's a lot of nuance under the surface. [1] https://github.com/anthropics/claudes-c-compiler/issues/1 https://github.com/anthropics/claudes-c-compiler/issues/1 [2] https://github.com/anthropics/claudes-c-compiler/issues/1#issuecomment-3860444835 https://github.com/anthropics/claudes-c-compiler/issues/1#is...
- 4corners4sides 8mo agoA compiler is another thing whose honor and pride that the models have taken from the nerds. In the past, people would debate for hours about the “dragon book” v.s. “writing interpreters” and present their cool bespoke compilers in Show HN articles. Now models can produce 100,000 lines of code over two weeks with no human intervention that actually work and can compile significant project. Which way now nerd? The models are getting better, are you? The article has some really odd low level descriptions of bash orchestration which I suppose are important to illustrate how barebones it was. However I always feel it odd when we’re talking about agents that are lauded as borderline super intelligence and there is still low level bash being slung around – feels like we’re talking about things at the wrong level. The point about writing extremely high quality tests reminds me a bit of the “hot mess theory of AI” (https://alignment.anthropic.com/2026/hot-mess-of-ai/ https://alignment.anthropic.com/2026/hot-mess-of-ai/) also made by anthropic where they essentially say that long horizon tasks are more likely to fall to incoherency than for a model to purposefully pursue incorrect results. This is phrased in the article as “Claude will work autonomously to solve whatever problem I give it. So it’s important that the task verifier is nearly perfect, otherwise Claude will solve the wrong problem”. The author also observes something that I’ve realised after the initial joy of seeing an agent one shot a task wore off – for a 30 minute agent task, 25 minutes may be spent doing exploration of the environment. While it would be an offence to give a human unvetted model generated documentation and runbooks (I’m looking at you emoji ridden README.md files becoming more common across Show HN), models should commit things like this to memory for themselves to avoid repeatedly paying the “discovery tax” on every new action. Errors, hallucinations or changes cause the generated docs to fail create more busywork for the agent but agent time is less valuable than finite human life.
- up2isomorphism 8mo agoThis is one of those “demo” that no serious people will use it, no other people will want to improve it ( because I can also use ai to generate one myself). It is just useful to show how “good” it is.