Android Adverse for Dynamic Languages

I believe that at some point I read that due to the fact that Android runs on Dalvik VM, for dynamic languages ​​for JVM (Clojure, Jython, JRuby, etc.) it would be difficult to get good performance on Dalvik (and therefore on Android). If I remember correctly, the reasoning was that under the hood, to achieve dynamic typing, there were quite a lot of exercises with java bytecode and that translating bytecode-> dalwick would not easily pick it up.

So should I avoid a dynamic JVM language if I want to develop for Android?




EDIT: I think I should have provided a little more context. I was considering using Clojure to develop Android applications. I thought about using Clojure for several reasons:

  • I want to know FP

  • I'm not interested in learning Java

  • Clojure seems to have very interesting language concepts (STM for example).

However, when I tried to write Android applications in Clojure, I found that the performance issue was unacceptable. But I found a blog post that said dynamically typed languages ​​(like Clojure) would have problems due to bytecode manipulation needed to get dynamic typing. Therefore, I was looking for independent confirmation that this is true or not. I should have known better than to assume that in this particular problem all dynamically typed JVM languages ​​can be considered the same thing. I guess I asked a rather broad question, so I think I should not be surprised that people did not quite understand what I asked.

+30
android dynamic jvm clojure
Jun 10 '09 at 2:01
source share
5 answers

Dan Bornstein gave a presentation on Dalvik on Google I / O. It's worth a look to find out about the system as a whole, including the limitations you care about. A specific issue of non-Java languages ​​compiled into Java bytecode occurs during Q & A.

Remco van 't Veer has a github project where he fixed Clojure to run on Android. Tim Riddell wrote a tutorial on how to use it .

As @sean mentioned here, sometimes there is a bigger problem than just performance. Dan Bornstein discusses this when asked about Jython, ~ 54: 00 in the video. There is currently no support for dynamic languages ​​that generate on- bytecode (because bytecode translation is not available at run time).

+17
Jul 04 '09 at 8:41
source share

Android just got scripts

+3
Jun 10 '09 at 2:34
source share

There are some fixes to make clojure work.

http://riddell.us/tutorial/clojure_android/clojure_android.html

I think the real problem is the use of bytecode generators in some dynamic languages; they will not generate byte code for Davlik V.M. Therefore, eval will not work.

+2
Jun 10 '09 at 2:12
source share

Given the phone's relatively limited hardware, you probably should just configure java and not worry about the dynamic jvm language. Dynamic languages ​​in jvm will not be as efficient as Java for my understanding.

In addition, the Android SDK is pretty robust and easy to write because I don’t think you will get so many benefits using something else.

+2
Jun 10 '09 at 2:17
source share

dynamic languages ​​for the JVM will be difficult to get good performance on Dalvik

Dynamic languages ​​are hard to reach for a good performance period. If you need performance, use a statically typed language like Java (or C #, F #, etc.).

+1
Apr 28 '15 at 8:59
source share



All Articles