The best route here is to have your new language emit C, instead of LLVM IR directly. That can run on the maximum amount of different platforms - everything has a C compiler, from typical OSes to the web to game consoles.
Emscripten is mostly tested on clang output, so it supports that subset of LLVM IR very well. Others might or might not work. As Bruce said, other languages have been tried, with varying success. For example Rust basically works for simple examples, except Rust needs a newer LLVM than emscripten's, so it is blocked on that. - Alon On Tue, Nov 11, 2014 at 6:17 PM, Alex Buchanan <[email protected]> wrote: > Hey all. > > I'm toying around with writing a programming language. So far, I've > decided to utilize LLVM for code generation. Then I thought, hey, wouldn't > it be cool if I could compile to JS too? That would make my language usable > in the browser! > > Enter emscripten. I was hoping I could just run emscripten on the LLVM IR > I've produced, and magically it would run in the browser. However, as far > as I can tell, emscripten is targeted primarily at C/C++. This line from > the docs makes me think that emscripten does not support arbitrary LLVM IR: > > "Do not attempt to bypass *emcc* and call the Emscripten tools > directly from your build system." > > So, that's all I know so far. I'll start digging into the code sometime > soon, but maybe I could get a head start from you. > > 1) Has anyone done this? > > 2) Where should I start looking? > > 3) Is this a massive amount of work, a decent amount, a small amount, or > plain and simple? > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
