What? Didn’t cursed lang do something similar like 6 or 7 months ago? These bombastic marketing tactics are getting tired.
We tasked Opus 4.6 using agent teams to build a C Compiler
11–20 of 787 posts
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#12All 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!
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#13Microsoft, OpenAI, Anthropic, XAI, all solving the wrong problems, your problems not the collective ones.
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#14[deleted]
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#15> 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 on…
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#16> 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 on…
Maybe I'm underestimating the simplicity of the C language, but that doesn't sound very plausible to me.
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#17This is almost like asking me to invent a path finding algorithm when I've been thought Dijkstra's and A*.
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#18Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#19> 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.
Re: We tasked Opus 4.6 using agent teams to build a C Compiler
#20> 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 on…
Can 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.