On Tue, Sep 25, 2012 at 9:22 PM, Ross Bamford <[email protected]> wrote: > Hi, > > On Saturday, 23 June 2012 12:27:31 UTC+1, mame82 wrote: >> >> A first naive approach using luajava was far to slow for a method called >> about 5k times per frame. I need a way to compile to Dalvik bytecode at >> runtime. >> >> Has anybody done sth like this, it seems impossible without the javac >> class? >> A scripting language supporting compilation to Dalvik DEX code would also >> help. > > Apologies for reviving an old thread. If you've already found a solution to > this, please ignore me :) > > We open-sourced Deelang, our lightweight in-app scripting language about a > year ago. Recently, I've been working on a native (i.e. DEX) compiler for > it. The compiler runs on-device and allows you to take script code and > compile it a runtime-generated Class. Right now it's almost feature-complete > but only tested to the extent that we use it in-house. It may well work for > your needs? And in any case, more testers are always welcome ;) >
So I guess my question is, what does this provide over something say like, Groovy, would that work on Android. Also, generating native != generating Dalvik bytecode, to me :-/ ... that would be ... generating bytecode. > You'll find the project at http://deelang.googlecode.com/ . To get the > native compiler, you'll need to check the DEXCOMPILER branch out of > subversion (a file release is planned soon, but not yet). Hm... You might be surprised that generating Dex doesn't help you as much here as you might think. Why? Because, let's say you're comparing this with code that you have running through an interpreter (okay, so you've converted your scripting language to a sort of intermediate form or something beforehand like Lua intermediate..) Now, your interpreter will run over this code in some systematic structure, and your wanting to use Dex is because you can translate this into Dalvik bytecode. But note! You will probably find that you will get "pretty good" perf out of this interpreter (sans bytecode generation) already, because Dalvik's (trace based) JIT will knock out "hot paths" of code along your bytecode generation. Do you have any firm numbers to support this either way? kris -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

