Live data from Hacker News

Emscripten - An LLVM-to-Javascript compiler

mozakai.blogspot.com

1–10 of 11 posts

Re: Emscripten - An LLVM-to-Javascript compiler

#2
I'd love to see someone compare the performance of generated C/C++ code https://code.google.com/p/emscripten/wiki/GeneratedCodeCompa... versus a (possibly non-trivial) native Javascript implementation in say, V8, Spidermonkey, or Nitro.

It'd be interesting to see how decent performance can get between the LLVM optimizations and the tracing/JIT of the newer JS engines.

Re: Emscripten - An LLVM-to-Javascript compiler

#3
post #2

I'd love to see someone compare the performance of generated C/C++ code https://code.google.com/p/emscripten/wiki/GeneratedCodeCompa... versus a (possibly non-trivial) native Javascript implementation in say, V8, Spidermonkey, or Nitro. It'd be interesting to see how decent performance can get between the LLVM optimizations and the tracing/JIT of the newer JS engines.

FWIW, the author did somewhat touch on the issue of performance at the end of the article: Of course speed is an issue here. Emscriptened benchmarks currently run at about 1/20th the speed of gcc -O0 run on the original C++. and goes on to explain where the performance loss comes from.

Re: Emscripten - An LLVM-to-Javascript compiler

#4
post #3
post #2

I'd love to see someone compare the performance of generated C/C++ code https://code.google.com/p/emscripten/wiki/GeneratedCodeCompa... versus a (possibly non-trivial) native Javascript implementation in say, V8, Spidermonkey, or Nitro. It'd be interesting to see how decent performance can get between the LLVM optimizations and the tracing/JIT of the newer JS engines.

FWIW, the author did somewhat touch on the issue of performance at the end of the article: Of course speed is an issue here. Emscriptened benchmarks currently run at about 1/20th the speed of gcc -O0 run on the original C++. and goes on to explain where the performance loss comes from.

Not terribly useful as comparisons go. GWT likes to compare itself to hand-written JavaScript, which tells a more practical story.

Re: Emscripten - An LLVM-to-Javascript compiler

#5
post #2

I'd love to see someone compare the performance of generated C/C++ code https://code.google.com/p/emscripten/wiki/GeneratedCodeCompa... versus a (possibly non-trivial) native Javascript implementation in say, V8, Spidermonkey, or Nitro. It'd be interesting to see how decent performance can get between the LLVM optimizations and the tracing/JIT of the newer JS engines.

I don't understand what you are asking for here.

Emscriptem doesn't generate C/C++ code, it generates Javascript, which then runs on top of a Javascript execution environment (V8 etc).

The real comparison would be some C/C++ code run though this and running in Javascript vs handwritten Javascript.

(It's possible what you mean is a comparison of the generated machine code from LLVM vs that from the Javascript engine. I agree that would be interesting, but I think you'd be better off comparing the machine code generated by a Javascript-on-LLVM implementation such as http://github.com/omo/jsllc vs that generated by a conventional Javascript runtime.)

Re: Emscripten - An LLVM-to-Javascript compiler

#6
To be honest, I'd use GWT (http://code.google.com/webtoolkit/overview.html) for this kind of thing. Does the same thing, only it's Java -> Javascript. Been around for four years now, and hell, it's Google. Their documentation is excellent, for a start.

If I weren't so comfortable in Java, though, I'd definitely think about using this.

Re: Emscripten - An LLVM-to-Javascript compiler

#7

To be honest, I'd use GWT ( http://code.google.com/webtoolkit/overview.html ) for this kind of thing. Does the same thing, only it's Java -> Javascript. Been around for four years now, and hell, it's Google. Their documentation is excellent, for a start. If I weren't so comfortable in Java, though, I'd definitely think about using this.

[deleted]

Re: Emscripten - An LLVM-to-Javascript compiler

#9
post #8

Alchemy llvm-to-actionscript gave us http://github.com/mkr3142/QuakeFlash , hope someone uses this to give us QuakeCanvas.

It looks like this project is part of a goal similar to that. According to a blog post, Emscripten is an attempt to port a 3D game engine to the web:

http://syntensity.blogspot.com/2010/08/emscripten.html

The game engine's website is here:

http://www.syntensity.com/

Hopefully this experiment works out - both of these projects looks very interesting!

Re: Emscripten - An LLVM-to-Javascript compiler

#10

To be honest, I'd use GWT ( http://code.google.com/webtoolkit/overview.html ) for this kind of thing. Does the same thing, only it's Java -> Javascript. Been around for four years now, and hell, it's Google. Their documentation is excellent, for a start. If I weren't so comfortable in Java, though, I'd definitely think about using this.

I think code bases that use C and those that use Java probably solve very different problems, though. No one is writing 3D engines in Java.
Post reply on HN