[LLVMdev] JavaScript Backend

David LaPalomento dlapalomento at gmail.com
Sun Oct 3 08:26:22 PDT 2010


Short answer: they're very similar. They both translate LLVM IR into
javascript, though there are some significant differences in how we've
gone about that. emscripten has its own stand-alone IR parser written
in javascript while I opted to do the translation as a regular backend
in the LLVM source tree, similar to the C backend. I contacted Alon
Zakai (emscripten's developer) before posting to this list and while
it doesn't look like a direct merge of the two projects is possible,
we're looking for ways to share some code and test cases. I'm not
familiar enough with emscripten to know which project is further along
at this point.

My ultimate goal in starting this was to give any language hosted on
LLVM the option to compile to the browser. I do a solid amount of web
app development myself and I must admit to being a bit jealous of the
javascript-on-the-server/Node.js crowd. Being able to share your
client and server-side codebase is a big win for application
developers and it seemed that targeting a shared language platform
like LLVM would open up that possibility for a lot of people. I chose
to implement it as a backend because I felt that having that
capability one day folded into LLVM proper would open it up to the
largest audience. It's still a ways off from that, certainly, but
that's the direction I'd like to head in.

David

On Sun, Oct 3, 2010 at 2:21 AM, Owen Anderson <resistor at mac.com> wrote:
>
> On Oct 2, 2010, at 8:11 PM, David LaPalomento wrote:
>
>> Hi all,
>> Over the past couple weeks, I've been putting together a JavaScript
>> backend for LLVM. At this point, I believe I've got reasonable
>> implementations for all the instructions, primitives and derived
>> types. I haven't gotten around to most of the intrinsics but I thought
>> it would be a good idea to start getting some feedback before going
>> much further. If anyone has the time and interest to check it out, the
>> repo is up at http://github.com/dmlap/llvm-js-backend.
>
> How does this compare to Empscripten? http://code.google.com/p/emscripten/
>
> --Owen
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list