Live data from Hacker News

We tasked Opus 4.6 using agent teams to build a C Compiler

anthropic.com

771–780 of 787 posts

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#771
post #763
post #656

Earlier quoted context omitted.

You can one shot prompt a toy C compiler. Getting one that can compile Linux in a bootable way is significantly harder.

Everybody talks as Linux is the most difficult thing to compile in the world. The reality is that linux is well written and designed with portability with crappy compilers in mind from the beginning. Also, the booting part, as stated some times, is discutable.

Just writing a non-toy C preprocessor is non-trivial.

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#772
post #332

Earlier quoted context omitted.

> Still a really cool project! Yeah. This test sorta definitely proves that AI is legit. Despite the millions of people still insisting it's a hoax. The fact that the optimizations aren't as good as the 40 year gcc project? Eh - I think people who focus on that are probably still in some serious denial.

It's amazing that it "works", but viability is another issue. It cost $20,000 and it worked, but it's also totally possible to spend $20,000 and have Claude shit out a pile of nonsense. You won't know until you've finished spending the money whether it will fail or not. Anthropic doesn't sell a contract that says "We'll only bill you if it works" like you can get from a bunch of humans. Do catastrophic bugs exist in…

Also, heaven knows if the result in maintainable or easy to change.

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#773
post #254

Earlier quoted context omitted.

Yeah, didn't mention gas or ld, for similar reasons. I agree that a compiler doesn't necessarily "need" those. I don't agree that all the claims are backed up by their own comments, which means that there's probably other places where it falls down. Its... Misrepresentation. Like Chicken is a Scheme compiler. But they're very up front that it depends on a C compiler. Here, they wrote a C compiler that is at least som…

Their C compiler is not reliant on having another C compiler around. Compiling the 16-bit real mode bootstrap for the Linux kernel on x86(-64) requires another C compiler; you certainly don't need another compiler to compile the kernel for another architecture, or to compile another piece of software not subject to the 32k constraint. The compiler itself is entirely functional; it just can't generate code optimal eno…

It also generates the wrong relocations for link time. And so cannot boot, even with help.

> The “compiles the kernel” claim needs a footnote. CCC compiles all the C source files, but the final binary cannot be produced because CCC generates incorrect relocations for kernel data structures (__jump_table, __ksymtab).

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#774

Earlier quoted context omitted.

I would be extremely surprised if it was that small.

I was curious about the scale of 1TiB of text. According to WolframAlpha, it's roughly 1.1 trillion characters, which breaks down to 180.2 billion words, 360.5 million pages, or 16.2 billion lines. In terms of professional typing speed, that's about 3800 years of continuous work. So post-deduplication, I think it's a fair assessment that a significant portion of high-quality text could fit within 1TiB. Tho 'high-qual…

Yes, a million books is a reasonably big library.

But I would be surprised if the internet only filled a reasonably big library.

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#775

Earlier quoted context omitted.

Claude was not reverse engineering here. By your definition no one can do a clean room implementation if they've taken a recent compilers course at university.

Claude was reverse engineering gcc. It was using it as an oracle and attempting to exactly march its output. That is the definition of reverse engineering. Since Claude was trained on the gcc source code, that’s not a clean room implementation. > By your definition no one can do a clean room implementation if they've taken a recent compilers course at university. Clean room implementation has a very specific definiti…

Why do you say it reversed engineered gcc instead of llvm? If you read the code it has much more of llvm concepts than gcc.

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#776
post #731
post #725

Earlier quoted context omitted.

We have investigated. Millions of people are investigating all the time and finding that the coding capacity has improved dramatically over that time. A variety of very different benchmarks say the same. This one random guy’s stupid prompt says otherwise. Come on.

As far as I remember, article stated that he found same problematic behavior for many prompts, issued by him and his colleagues. The "stupid prompt" in article is for demonstration purposes.

But that’s not an argument, that’s just assertion, and it’s directly contradicted by all the more rigorous attempts to do the same thing through benchmarks (public and private).

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#777
post #762

Earlier quoted context omitted.

> you could probably get a human to whip you up a C compiler for a lot less than $20k I fork Clang or GCC and rename it. I'll take only $10k.

My question, which I didn’t still find anybody asking: how many compilers, including but not limited to the 2 most famous, were in the training set.

Certainly tcc. Probably also rui314's chibicc as it's relatively popular. sdcc is likely in there as well. Among numerous others that are either proprietary or not as well known.

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#778

Earlier 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…

All you have to do is record a table of fixup locations you can fill in in a second pass once the labels are resolved.

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#779

Earlier 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…

All you have to do is record a table of fixup locations you can fill in in a second pass once the labels are resolved.

In practice, one of the difficulties in getting _clang_ to assemble the Linux kernel (as opposed to GNU `as` aka GAS), was having clang implement support for "fragments" in more places.

https://eli.thegreenplace.net/2013/01/03/assembler-relaxatio...

There were a few cases IIRC around usage of the `.` operator which means something to the effect of "the current point in the program." It can be used in complex expressions, and sometimes resolving those requires multiple passes. So supporting GAS compatible syntax in more than just the basic cases forces the architecture of your assembler to be multi-pass.

Re: We tasked Opus 4.6 using agent teams to build a C Compiler

#780

Earlier quoted context omitted.

> On top of that, Anthropic is losing money on it. It seems they are *not* losing money on inference: https://bsky.app/profile/steveklabnik.com/post/3mdirf7tj5s2e

no, and that is widely known. the actual problem is that the margins are not sufficient at that scale to make up for the gargantuan training costs to train their SOTA model.

They are large enough to cover their previous training costs but not their next gen training costs.

i.e They made more money on 3.5 than 3.5 cost to train, but didn't make enough money on 3.5 to train 4.0.

Post reply on HN