4 ms·
Ask HN: Could LMs practically take text and directly generate IL/CPU opcodes?
- deleted 2y ago[deleted]
- andrewfromx 2y agoha not even assembly? Right to opcodes?
- wseqyrku 2y agoI mean any kind of "machine code" as opposed to another programming language, say Java bytecode. Theoretically another programming language is enough, but LMs are already designed to process massive number of tokens in and out, the question is why not map/stream that to something and that hardware could run?
- beardyw 2y agoPerhaps because you would have even less idea what it is doing if it goes wrong.
- davydm 2y agoSure, why not? Code is code. Given the full instruction set, and trained on outputs from known code, it could produce the same buggy slop it usually does, but now, even harder to debug! Yay!
- petercooper 2y agoYou could train a model to do that. However, it'd probably be more practical to have an intermediate step like a text representation or some sort of script that then generates the final machine code (not necessarily assembly). I just asked o3-mini "Can you write a Python script that outputs the bytecode to a file for a very basic JVM application that prints hello world?" and it actually did it, complete with bytecode, and it ran. (One benefit of this approach is it leaves comments next to each block of bytecode, which probably helps it contextually with generating the next ones.)