Live data from Hacker News

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

anthropic.com

761–770 of 787 posts

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

#761
post #416

Earlier quoted context omitted.

[flagged]

I can't stress enough how much LOC is not a measure of anything .

In fact it is. And can be useful. IF you have quality controls in place, so the code has a reasonable quality, the LOC will correlate with amount of functionality and/or complexity. Is a good metric? No. Can be used just like that to compare arbitrary code bases, absolutely no!

As a seasoned manager, I have an idea how long a feature should take, both in implementing effort and longness of code. I hace to know it, is my everyday work.

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

#762

Earlier quoted context omitted.

You wouldn’t pay a human to write 100k LOC. Or at least you shouldn’t. You’d pay a human to write a working useful compiler that isn’t riddled with copyright issues. If you didn’t care about copying code, usefulness, or correctness you could probably get a human to whip you up a C compiler for a lot less than $20k.

> 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.

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

#763
post #656

Earlier quoted context omitted.

What's so hard about it? Compiler construction is well researched topic and taught in the universities. I made toy language compiler as a student. May be I'm underestimating this task, but I think that I can build some simple C compiler which will output trivial assembly. Given my salary of $2500, that would probably take me around a year, so that's pretty close LoL.

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.

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

#764
post #724

Earlier quoted context omitted.

Yep. Building a working C compiler that compiles Linux is an impossible task for all but the top 1% of developers. And the ones that could do it have better things to do, plus they’d want a lot more than 20K for the trouble.

Some of the hardest parts of the compiler are optimization and clear error handling/reporting. If you forego those - because you're testing against a codebase that is already free of things that break compilation and have no particular performance requirements for the generated code - it's a substantially simpler task.

Making a basic C compiler, without much error/warn detection and/or optimizations, is as a matter if fact no so difficult. In many Universities is a semester project for 2 to 3 students.

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

#765

Earlier quoted context omitted.

https://news.ycombinator.com/item?id=46909529

I’ll be shocked if they are able to do it in 4 months, never mind 4 weeks.

Have you ever seen Tsoding youtube channel? I’m sure Mr Zosin can very much do it in one week. And considering russian salaries, it will be like an order of magnitude cheaper.

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

#766

Earlier quoted context omitted.

Interesting, why impossible? We studied compiler construction at uni. I might have to dig out a few books, but I’m confident I could write one. I can’t imagine anyone on my course of 120 nerds being unable to do this.

You are underestimating the complexity of the task so do other people on the thread. It's not trivial to implement a working C compiler very much so to implement the one that proves its worth by successfully compiling one of the largest open-source code repositories ever, which btw is not even a plain ISO C dialect.

They did bot compile the whole linux, mind you, just an absolute minimal kernel.

Doing a real compiler to be used by humans is difficult. Doing a compiler that “gets the thing done” is a different thing.

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

#767
post #546
post #482

Earlier quoted context omitted.

Well, how is your Solaris installation going? I also remember having gone into research, because there were no jobs available, and even though I was employed at the time, our salaries weren't being paid.

What does this even mean?

Seems you don’t remember much of that time. Let me refresh: “we are the dot in dot com”

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

#768
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.

The reality is you can build Linux with gcc and clang. And that’s it. Years ago you could use Intel’s icc compiler, but that stopped being supported. Let’s stop pretending it’s an undergrad project.

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

#769

Earlier quoted context omitted.

What is a single example where the optimal encoding depends on context? (I am assuming you're just doing an assembler where registers have already been chosen, vs. a compiler that can choose sse vs. scalar and do register allocation etc.)?

“mov rcx, 0”. At least one assembler (the Go assembler) would at one point blindly (and arguably, incorrectly) rewrite this to “xor rcx, rcx”, which is smaller but modifies flags, which “mov” does not. I believe Go fixed this later, possibly by looking at surrounding instructions to see if the flags were being used, for instance by an “adc” later, to know if the assembler needs to pick the larger “mov” encoding. Whet…

Ok fair, I saw that as out of scope for an assembler - since that is a different instruction not just how to encode.

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

#770
post #739

Earlier quoted context omitted.

I wrote a couple hobby compilers. The only difficulty with C is the ambiguous syntax. Now compare the article's setup with a single senior engineer who uses an agent or two at the same time.

> I wrote a couple hobby compilers. So did most of us, join the club. What you can't do is write such a compiler for $20k if you want to put food on the table, or do it in two weeks (what it costs to buy your time currently until AI eats your job). And let's be honest: it's not going to build something of the complexity of Linux either. Hobby compilers run hobby code. Giant decades-old source trees test edge cases li…

I don't really get what you're arguing. Yes, battle hardened compilers are great. No, I can't write one in two weeks, and neither can a group of AI bots.

The result is a heap of technical debt so unmanageably large that it's almost an exponential cost to keep adding to it.

Post reply on HN