Using LLVM as virtual machine - multiplatform and multiarchitecture coding -


i'm working in pet programming language (for learning purposes), , have gone through lot of research on past year, , think time start modelling concepts of such languague. first of want compile intermediate form, such jvm or .net bytecode, goal being multiplatform/architecture compatibily. second, want fast (i have many other things in mind, not purpose of topic discuss those).

the best options came mind were: compile jvm bytecode , use openjdk runtime environment, compile .net bytecode , use mono runtime environment, compile llvm ir , use llvm runtime environment.

as may have imagined, i've chosen llvm. why? because blazing fast. did little benchmark using c++ n-body code, , achieved 7s in machine lli jitted ir, in contrast 27s clang native compiled code (i know clang first make ir machine code).

so, here question: there redistributable version of llvm basic toolset (i need lli) can use? or must compile own? if latter, can provide me hints on how it? if must it, i'm thinking cross-compiling them machine (intel mac), , generating installers (say, .msi windows, .rpm , .deb popular linux distros , .pkg macs). remember, need minimal subset of llvm, such subset capable of acting vm, using "lli ". real question here how use llvm typical virtual machine.

first, think 3 options - llvm ir + llvm, java bytecode + openjdk, , .net cil + mono - excellent options, , agree deciding between them not easy.

if go llvm , want use lli, can compile llvm target platform , pack resulting lli executable distribution, should work.

another way write jit compiler via llvm use execution engine - see handy examples in kaleidoscope tutorial. means write own program jit-compile own language, compile whatever platform want while statically linking llvm, , distribute it.

in case, since jit compiler requires copying llvm binary client side, make sure attach copyright notice distribution (you don't have open-source distribution, though).


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -