Hi David,

Le 4 avr. 2011 à 00:05, David Chisnall a écrit :

> I've committed this code in Languages/ObjC2JS.  It builds as a clang plugin, 
> which uses clang to generates an abstract syntax tree and then walks it 
> emitting JavaScript.

I was wondering what's your take about the LLVM bitcode interpreter approach 
taken by the Emscripten project. See https://github.com/kripken/emscripten/wiki

>From what I understand, there are more room for optimizations by emitting JS 
>code from the Clang AST. For example, C or ObjC loops constructs can be 
>remapped to JS loops, or ObjC message sends might be more easy to optimize 
>(e.g. by inserting type feedback optimizations written in JS).

However this means that another code generator will have to be written to 
compile the LK languages to JS, when Emscripten would involve no extra code 
generator.
Given that they claim there are a lot of rooms for optimizations in their 
approach (see 
https://github.com/kripken/emscripten/raw/8a6e2d67c156d9eaedf88b752be4d1cf4242e088/docs/paper.pdf),
 why did you choose to emit JS code from the Clang AST?

Would message send optimizations be possible with Emscripten? Just harder than 
with your approach?

Could your choice also be related that LLVM seems to lack some elements to 
build a VM that would interpret the LLVM bitcode? Especially when you consider 
the live optimizations (e.g. profiling and inlining method calls while running) 
that a Java VM supports?

Cheers,
Quentin.


_______________________________________________
Etoile-dev mailing list
Etoile-dev@gna.org
https://mail.gna.org/listinfo/etoile-dev

Reply via email to