Reputation: 3
I'm working on my own program language which can be created in a web based editor. I want to translate my code to LLVM-IR on client side. The IR code will be transfer, translate to instruction set and execute on an embedded device.
Well, my plan is to create a lexer, parser and code-generator in C/C++ which used the LLVM-API to create LLVM-IR code. Later I will translate my C/C++ code to JavaScript by using emscripten.
However i need to translate the LLVM-toolchain to JavaScript before i can convert my own project to javascript. But does anybody knows if it is possible to translate the LLVM to JavaScript?
I found a similar question here: Can Emscripten compile LLVM to JavaScript?
But with no clear result...
Or does anyboy have comments to my plan?
Thanks a lot!
Upvotes: 0
Views: 401
Reputation: 1048
LLVM itself has been compiled, but a while ago. It would take some effort to port it now. It's also fairly large, which can be a problem in browsers.
You would also need to port parts of emscripten, which are written in python.
Overall this is all possible, but would take nontrivial effort.
Upvotes: 1