Not to brag, but if anthropic had paid me $20,000 and given me a month I'd also have been able to write them a very shitty C compiler.
Not to brag, but if anthropic had paid me $20,000 and given me a month I'd also have been able to write them a very shitty C compiler.
@david_chisnall I think the whole thing is pretty disingenuous.
They picked "compiler" because it sounds impressive, but a compiler that does essentially no optimization, doesn't have a preprocessor or assembler, and apparently doesn't even do register allocation isn't really that impressive.
I really do think a competent human could do it in a month by THOSE standards.
I think even your summary is quite generous. C compilers like TCC and PCC that do statement-by-statement translation, even with no optimisations, generate code that performs better.
A while ago, someone wrote an asm.js back end for clang and showed that C code compiled to JavaScript and JIT compiled in a modern VM performed about as well as statically compiled C (sometimes a bit worse, sometimes a bit better). But they also tried running the generated code with simple JavaScript interpreters like DukTape. And that ran faster than the output of this thing. It would actually be quite hard to write something this bad deliberately.
@david_chisnall I totally agree.
I was being as "generous" as I was because there's so much misinfo on this thing online now, and if you talk honestly about it people think that the "truth is in the middle".
But yes, this thing is worse than just doing a naive "transpilation" from C to assembly... somehow.