Live data from Hacker News

Claude’s C Compiler vs. GCC

harshanu.space

31–40 of 377 posts

Re: Claude’s C Compiler vs. GCC

#31

The prospect of going the last mile to fix the remaining problems reminds me of the old joke: "The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time."

Yeah, this is why I dont get the argument that LLMs are good for bootstrapping. Especially anything serious.

Sure these things can technically frontload a lot of work at the beginning of a project, but I would argue the design choices made at the beginning of a project set the tone for the entire project, and its best those be made with intention, not stochastic text extruders.

Lets be real these things are shortcut machines that appeal to people's laziness, and as with most shortcuts in life, they come with consequences.

Have fun with your "Think for me SaaS" im not going to let my brain atrophy to the point where my competency is 1:1 correlated to the quantity and quality or tokens I have access too.

Re: Claude’s C Compiler vs. GCC

#32
post #6

Since Claude Code can browse the web, is it fair to think of it as “rewriting and simplifying a compiler originally written in C++ into Rust”?

In the original post Anthropic did point out that Claude Code did not have access to the internet

Presumably it had access to GCC (and LLVM/Clang) sources in it's training data? All of which are hosted or mirrored on Github.

Re: Claude’s C Compiler vs. GCC

#33
post #14

I think this is a great example of both points of view in the ongoing debate. Pro-LLM coding agents: look! a working compiler built in a few hours by an agent! this is amazing! Anti-LLM coding agents: it's not a working compiler, though. And it doesn't matter how few hours it took, because it doesn't work. It's useless. Pro: Sure, but we can get the agent to fix that. Anti: Can you, though? We've seen that the more c…

Pretty much. It's missing a tiny detail though. One side is demanding we keep giving hundreds of billions to them and at the same time promising the other side's unemployment.

You’re copping downvotes for this, but you’re not wrong.

“It will get better, and then we will use it to make many of you unemployed”

Colour-me-shocked that swathes of this industry might have an issue with that.

Re: Claude’s C Compiler vs. GCC

#34

I think this is a great example of both points of view in the ongoing debate. Pro-LLM coding agents: look! a working compiler built in a few hours by an agent! this is amazing! Anti-LLM coding agents: it's not a working compiler, though. And it doesn't matter how few hours it took, because it doesn't work. It's useless. Pro: Sure, but we can get the agent to fix that. Anti: Can you, though? We've seen that the more c…

> Pro: Sure, maybe now, but the next generation will fix it.

Do we need a c2 wiki page for "sufficiently smart LLM" like we do for https://wiki.c2.com/?SufficientlySmartCompiler ?

Re: Claude’s C Compiler vs. GCC

#35
post #11

But gcc is part of it's training data so of course it spit out an autocomplete of a working compiler /s This is actually a nice case study in why agentic LLMs do kind of think. It's by no means the same code or compiler. It had to figure out lots and lots of problems along the way to get to the point of tests passing.

> But gcc is part of it's training data so of course it spit out an autocomplete of a working compiler /s

Why the sarcasm tag? It is almost certainly trained on several compiler codebases, plus probably dozens of small "toy" C compilers created as hobby / school projects.

It's an interesting benchmark not because the LLM did something novel, but because it evidently stayed focused and maintained consistency long enough for a project of this complexity.

Re: Claude’s C Compiler vs. GCC

#36
post #5

Earlier quoted context omitted.

What is the typedef problem?

If stevefan1999's referring to a nasty frontend issue, it might be due to the fact that a name introduced by a typedef and an identical identifier can mingle in the same scope, which makes parsing pretty nasty – e.g. (example from source at end): typedef int AA; void foo() { AA AA; /\* OK - define variable AA of type AA */ int BB = AA * 2; /\* OK - AA is just a variable name here \*/ } void bar() { int aa = sizeof(AA…

In your example bar is actually trivial, since both the type AA and the variable AA are ints both aa and bb ends up as 4 no matter how you parse it. AA has to be typedef'd to something other than int.

Re: Claude’s C Compiler vs. GCC

#37
Something that bothers me here is that Anthropic claimed in their blog post that the Linux kernel could boot on x86 - is this not actually true then? They just made that part up?

It seemed pretty unambiguous to me from the blog post that they were saying the kernel could boot on all three arch's, but clearly that's not true unless they did some serious hand-waving with kernel config options. Looking closer in the repo they only show a claimed Linux boot for RISC-V, so...

[0]: https://www.anthropic.com/engineering/building-c-compiler - "build a bootable Linux 6.9 on x86, ARM, and RISC-V."

[1]: https://github.com/anthropics/claudes-c-compiler/blob/main/B... - only shows a test of RISC-V

Re: Claude’s C Compiler vs. GCC

#38
They should have gone one step further and also optimized for query performance (without editing the source code).

I have cough AI generated an x86 to x86 compiler (takes x86 in, replaces arbitrary instructions with functions and spits x86 out), at first it was horrible, but letting it work for 2 more days it was actually close to only 50% to 60% slowdown when every memory read instruction was replaced.

Now that's when people should get scared. But it's also reasonable to assume that CCC will look closer to GCC at that point, maybe influenced by other compilers as well. Tell it to write an arm compiler and it will never succeed (probably, maybe can use an intermeriadry and shove it into LLVM and it'll work, but at that point it is no longer a "C" compiler).

Re: Claude’s C Compiler vs. GCC

#39

I think this is a great example of both points of view in the ongoing debate. Pro-LLM coding agents: look! a working compiler built in a few hours by an agent! this is amazing! Anti-LLM coding agents: it's not a working compiler, though. And it doesn't matter how few hours it took, because it doesn't work. It's useless. Pro: Sure, but we can get the agent to fix that. Anti: Can you, though? We've seen that the more c…

I'm reminded, once again, of the recent "vibe coded" OCaml fiasco[1].

The PR author had zero understanding why their entirely LLM-generated contribution was viewed so suspiciously.

The article validates a significant point: it is one thing to have passing tests and be able to produce output that resembles correctness - however it's something entirely different for that output to be good and maintainable.

[1] https://github.com/ocaml/ocaml/pull/14369

Re: Claude’s C Compiler vs. GCC

#40
Did Anthropic release the scaffolding, harnesses, prompts, etc. they used to build their compiler? That would be an even cooler flex to be able to go and say "Here, if you still doubt, run this and build your own! And show us what else you can build using these techniques."
Post reply on HN