On Wed, Nov 12, 2014 at 9:17 AM, 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!
>

People have experimented with this in the past. I'm not sure if any have
had success or not.


> 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."
>

What that means is that you should not try calling the underlying
emscripten.py and other tools directly.  emcc can take a bitcode file, so
you don't have to feed it C / C++.

    emcc whatever.bc -o whatever.html

You'll want to make sure that you build your bitcode for the right target
and with the right data layout.

Good luck,

 - Bruce

-- 
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.

Reply via email to