Live data from Hacker News

Claude’s C Compiler vs. GCC

harshanu.space

121–130 of 377 posts

Re: Claude’s C Compiler vs. GCC

#121

Earlier quoted context omitted.

> People aren't prompting LLMs to write good, maintainable code though. Then they're not using the tools correctly. LLMs are capable of producing good clean code, but they need to be carefully instructed as to how. I recently used Gemini to build my first Android app, and I have zero experience with Kotlin or most of the libraries (but I have done many years of enterprise Java in my career). When I started I first ha…

When I started I first had a long discussion with the AI... and made a big Markdown file with a detailed architecture description. Yep, that's how you get better output from AI. A lot of devs haven't learned that yet. They still see it as 'better autocomplete'.

While this technique works for new projects, it takes no more than a couple of pivots for it to completely fail.

A good AI development framework needs to support a tail of deprecated choices in the codebase.

Skills are considerable better for this than design docs.

Re: Claude’s C Compiler vs. GCC

#122
post #12

Earlier quoted context omitted.

What is the typedef problem?

Lexical parsing C is simple, except that typedef's technically make it non-context-free. See https://en.wikipedia.org/wiki/Lexer_hack When handwriting a parser, it's no big deal, but it's often a stumbling block for parser generators or other formal approaches. Though, I recall there's a PEG-based parser for C99/C11 floating around that was supposed to be compliant. But I'm having trouble finding a link, and maybe it…

I think you're referring to this one: https://github.com/jhjourdan/C11parser

Re: Claude’s C Compiler vs. GCC

#123

Earlier quoted context omitted.

> People aren't prompting LLMs to write good, maintainable code though. Then they're not using the tools correctly. LLMs are capable of producing good clean code, but they need to be carefully instructed as to how. I recently used Gemini to build my first Android app, and I have zero experience with Kotlin or most of the libraries (but I have done many years of enterprise Java in my career). When I started I first ha…

Not trying to be rude, but in a technology you're not familiar with you might not be able to know what good code is, and even less so if it's maintainable. Finding and fixing that subtle, hard to reproduce bug that could kill your business after 3 years.

That's a fair point, my code is likely to have some warts that an experienced Android/Kotlin dev would wince at. All I know is that the app has a structure that makes an overall sense to me, with my 15+ years of experience as a professional developer and working with many large codebases.

Re: Claude’s C Compiler vs. GCC

#125
post #93
post #39

Earlier quoted context omitted.

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:/…

I just read that whole thread and I think the author made the mistake of submitting a 13k loc PR, but other than that - while he gets downvoted to hell on every comment - he's actually acting professionally and politely. I wouldn't call this a fiasco, it reads to me more that being able to create huge amounts of code - whether the end result works well or not - breaks the traditional model of open source. Small contr…

He is not polite, he is of the utmost rudeness. As a reply to being pointed to the fact that he copied so much code that the generated code included someone else's name in the License, his reply was https://github.com/ocaml/ocaml/pull/14369/changes/ce372a60bd...

I struggle to think how someone thinks this is polite. Is politeness to you just not using curse words?

Re: Claude’s C Compiler vs. GCC

#127
post #106

Earlier quoted context omitted.

I am inclined to agree with you... but, did CC produce a working linker as well as a working compiler? I thought it was just the compiler that Anthropic produced.

Why would the correct output of a C compiler not work with a standard linker?

> Why would the correct output of a C compiler not work with a standard linker?

I feel it should for a specific platform/target, but I don't know if it did.

Writing a linker is still a lot of work, so if their original $20k cost of production did not include a linker I'd be less impressed.

Which raises the question, did CC also produce its own pre-processor or just use one of the many free ones?

Re: Claude’s C Compiler vs. GCC

#128

Can someone explain to me, what’s the big deal about this? The AI model was trained on lots of code and spit out sonething similar than gcc. Why is this revolutionary?

It's a marketing gimmick. Cursor did the same recently when they claimed to have created a working browsers but it was basically just a bunch of open source software glued together into something barely functional for a PR stunt.

Incorrect. This compiler can compile and run doom.

Re: Claude’s C Compiler vs. GCC

#129
post #19

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…

> It's not fair to compare them like this! As someone who leans pro in this debate, I don't think I would make that statement. I would say the results are exactly as we expect. Also, a highly verifiable task like this is well suited to LLMs, and I expect within the next ~2 years AI tools will produce a better compiler than gcc.

> I expect within the next ~2 years AI tools will produce a better compiler than gcc.

Building a "better compiler than gcc" is a matter of cutting-age scientific research, not of being able to write good code

Re: Claude’s C Compiler vs. GCC

#130
This is a good example of ALL AI slop. You get something barely working, and are faced with the next problem:

- Deal with legacy code from day one.

- Have mess of a codebase that is most likely 10-20x the amount of LOC compared to human code

- Have your program be really slow and filled with bugs and edge cases.

This is the battlefield for programmers. You either just build the damn thing or fix bugs for the next decade.

Post reply on HN