[LLVMdev] LLVM IR execution in JavaScript

Sebastian Redl sebastian.redl at getdesigned.at
Wed Jan 2 11:44:27 PST 2013


On 02.01.2013, at 20:37, Alon Zakai wrote:

> 
> 
> ----- Original Message -----
>> From: "Sebastian Redl" <sebastian.redl at getdesigned.at>
>> 
>> It would be awesome to combine the llvm.org demo with the in-browser
>> emscripten (or possibly a server-side emscripten) so that the user
>> can execute his snippets in the browser.
>> 
>> This would be especially awesome for a C++ tutorial page. Instead of
>> having to start with the arduous process of setting up a compiler
>> environment, the user could jump straight into the fun by typing his
>> programs in the web page and executing them there.
>> 
> 
> It would definitely be nice to allow compiling C++ to LLVM IR to JS all in the browser, yeah! That means compiling clang to JS though, which would require a fairly large download I think. If there is a way to compile clang with just the parts we need though (just compile a single C/C++ file to only LLVM IR, nothing else) then this would be much simpler.

I think speed and download considerations alone make it more reasonable to compile everything on the server, the way the current llvm.org demo page does, but use emscripten's target description, and then run emscripten (also on the server) to generate JS, which can then be loaded back into the web page and executed.

Sebastian



More information about the llvm-dev mailing list