LLVM

Monkey Targets Forums/User Targets/LLVM

frank(Posted 2012) [#1]
I'm wondering if anyone thought about making a Monkey LLVM frontend? That would, based on a solid optimizing framework of LLVM, allow compilation to all targets LLVM backends. I cannot find a list of backends, but there are backends for Javascript, jvm, .net (including mono), C, assembly (intel, arm and more) and a lot more (to follow).


AdamRedwoods(Posted 2013) [#2]
You would still need a way to setup a window/input/files/graphics framework for each OS, so the project would become complex quickly.


frank(Posted 2013) [#3]
I think some people did that, like Emscripten. Not sure how complex it is :) Could be very complex.


ziggy(Posted 2013) [#4]
It is very complex, as it is a very low level virtual machine. That is, no classes or other funcy stuff you can find on the available Monkey translators, so it would mean a lot of work for Mark (or anyone) writing the LLVM assembler translator. It is a bit like traditional x86 assembler but with infinite registers (usage of registers is resolved on devirtualization step on final machine code compilation AFAIK).