Discussion
Loading...

Discussion

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
HP van Braam
HP van Braam
@hp@mastodon.tmm.cx  ·  activity timestamp 20 hours ago

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.

  • Copy link
  • Flag this post
  • Block
David Chisnall (*Now with 50% more sarcasm!*)
David Chisnall (*Now with 50% more sarcasm!*)
@david_chisnall@infosec.exchange replied  ·  activity timestamp 4 hours ago

@hp

It's an interesting data point. The C compiler is worse than the Tiny C Compiler in terms of code-generation quality. That was a one-person effort. Admittedly Fabrice is a very smart person, but still.

The quality of the generated code is worse than most undergraduate compiler assignments.

  • Copy link
  • Flag this comment
  • Block
HP van Braam
HP van Braam
@hp@mastodon.tmm.cx replied  ·  activity timestamp 4 hours ago

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

  • Copy link
  • Flag this comment
  • Block
David Chisnall (*Now with 50% more sarcasm!*)
David Chisnall (*Now with 50% more sarcasm!*)
@david_chisnall@infosec.exchange replied  ·  activity timestamp 4 hours ago

@hp

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.

  • Copy link
  • Flag this comment
  • Block
HP van Braam
HP van Braam
@hp@mastodon.tmm.cx replied  ·  activity timestamp 4 hours ago

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

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.27 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct