0

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!

0

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, that's what I through. The last port is 2 years ago. At the moment, I have only the parts compiled which are needed to build the LLVM IR in the Browser (lib/IR and lib/Support of the LLVM Root folder). This works really good and is enough at the moment. So, i will spend more effort to port LLVM if i needed. Thank a lot for your answer!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.