4 ms·
Why is compiling to LLVM bytecode insane? Compiling to bytecode and then working with a simpler language has worked for decades since the introduction of BCPL.
by onei 7y ago
Why is compiling to LLVM bytecode insane? Compiling to bytecode and then working with a simpler language has worked for decades since the introduction of BCPL.
It's also the approach used by Open64, where you compile to WHIRL which is then optimised with successive passes until you eventually output whatever the architecture can run.
- kick 7y agoGood question! BCPL's O-Code is far different from LLVM bytecode. O-Code was little more than a virtual stack machine. Very similar to Forth, though slightly more complicated. I could be wrong, but isn't Open64 more or less dead? The only thing I can think of that actually uses it (CUDA) isn't best-in-class.
- ZeRoo 7y agoSo u say, LLVM or whatever is insane because it's large. so what do u think about QBE[0] ? 0 : https://c9x.me/compile/ https://c9x.me/compile/
- kick 7y agoI don't know enough about QBE to give a well-informed assessment of it, so I'll refrain.
- onei 7y agoI believe you're correct about Open64, but it was an interesting examples of a compiler when I was researching them last, particularly its usage of WHIRL [1]. It's a similar approach as used by GCC and LLVM with their front, middle and back-end approach, although I can't quite remember if it pioneered that approach or not. [1] https://www.mcs.anl.gov/OpenAD/open64A.pdf https://www.mcs.anl.gov/OpenAD/open64A.pdf
- pjmlp 7y agoCompiling to bytecode is almost a decade older than BCPL, was the way to go at Xerox PARC and most mainframes that survive to this day.
- onei 7y agoFrom what I can tell, Xerox PARC didn't exist until 1970 and apparently used Smalltalk, which was after BCPL in 1967. I don't doubt you're correct, so do you have any links for earlier bytecode examples?
- pjmlp 7y agoBurroughs Large Systems, released into the market in 1961, nowadays sold as Unisys ClearPath MCP mainframes. Xerox PARC had Smalltalk, Mesa (later Mesa/Cedar) and Interlisp-D. The platforms would first load the respective microcode into the CPU for the bytecodes used by the desired workstation environment. Initially Xerox PARC made use of BCPL, but quickly they realised it wasn't the best way to write systems software and created Mesa to replace it. After all, BCPL was intended to bootstrap CPL, not to write fully systems with it. Other 60's computer companies were making use of either Algol or PL/I dialects, all the way up to the 80's. Lots of juice papers at Bitsavers.