3 ms·
Cool project, and FWIW it's like one Claude prompt to add MIPS support to this. I did that and then was able to compile my little custom language to the N64.
by superdisk 5mo ago
Cool project, and FWIW it's like one Claude prompt to add MIPS support to this. I did that and then was able to compile my little custom language to the N64.
- ursuscamp 5mo agoTruly amazing times. Just doing things has never been easier, and it has really reinvigorated me.
- vintagedave 5mo ago> I did that Can you contribute it? I don't see it listed as an official backend.
- kouosi 5mo ago> Can you contribute it? I don't see it listed as an official backend. I don't think anyone wants AI generated contribution to QBE (neither do I).
- nivethan 5mo agoI'm starting to think I should post my prompts if the model one shots it as I don't think the code itself is worth putting out.
- superdisk 5mo agoAs the other commenter said, I don't think contributing it would be that useful, since QBE is a rather zen-garden project and I don't think the author would accept slop. Also he could just generate it with a prompt himself :P It's certainly fun as a toy though!
- Rochus 5mo ago> it's like one Claude prompt to add MIPS support to this Can you provide the code somewhere? Is it complete? Does it really work? I have a hard time to believe that an LLM really can generate a complete and working backend for a target architecture with "one prompt". From my experience with such tools, by the end of the day it takes longer until it covers all edge cases and actually works than when writing it myself.
- Tiberium 5mo agoThey absolutely can for simpler cases like this, especially recent GPT 5.x models are amazing at such lower-level compiler work.
- superdisk 5mo agoThe backend is only ~1300 lines. QBE is a super simple project which is why adding a backend to it worked so well. I just pointed Claude at the existing RISC-V backend for reference and it whipped up the MIPS one. It really does work, though there might be bugs I didn't run into. I compiled an Amiga MOD player, written in my language, to the N64 and it worked fine, if that gives you an idea of how stress tested it was. IIRC it runs about 5x slower than GCC-generated code. https://gist.github.com/SuperDisk/1aa50263a773143c82a39d4771efac27 https://gist.github.com/SuperDisk/1aa50263a773143c82a39d4771...
- Rochus 5mo agoInteresting, thanks for posting. I had a first look and think that the AI has messed up with the floating-point and casting instructions (i.e. just copied over the RV instructions). I also spotted other places (e.g. TLS) which look like RV. It's also surprising that the code - as you say - is so much slower than (optimized?) GCC, since QBE is assumed to be at 70-80%.
- fuhsnn 5mo agoThe page says "aims to provide 70%" though, funny how words spread.
- Rochus 5mo agoThere are reports by independend testers (e.g. https://briancallahan.net/blog/20211010.html https://briancallahan.net/blog/20211010.html or https://news.ycombinator.com/item?id=40350384 https://news.ycombinator.com/item?id=40350384) suggesting that range.