News for hackers. Stuff that matters.
Re:C'mon, stop writing Java for Android by GeorgeTirebiter on Wednesday May 25, 2011 @02:30PM (#2584992)
I've heard that folks have done it (more than a year ago) but, apparently, the runtime takes a while to load and that makes the app practically unusable.
Re:C'mon, stop writing Java for Android by vmind on Wednesday May 25, 2011 @02:35PM (#2585009)
I think the issue with Clojure is that it does runtime bytecode rewriting for macros, so to get the whole language working on android they had to bundle the dalvik translator as well.
Re:C'mon, stop writing Java for Android by technomancy on Wednesday May 25, 2011 @03:26PM (#2585188)
> I think the issue with Clojure is that it does runtime bytecode rewriting for macros

This is actually very rare; nearly all bytecode generation in Clojure apps can happen ahead-of-time. But Clojure relies heavily on Hotspot's world-class JIT (the bytecode Clojure's compiler outputs is only optimized in so far as making it easy for Hotspot to optimize it.)

In addition, use of persistent data structures puts more strain on the GC; another place where Hotspot is leaps and bounds ahead of Dalvik. You can bypass this by using Java arrays directly, but it's very awkward and un-idiomatic.

Re:C'mon, stop writing Java for Android by ygooshed on Thursday May 26, 2011 @11:29AM (#2588073)
i love to use scala on android. has anyone developed any 'real' app with scala on android?
Re:C'mon, stop writing Java for Android by runevault on Wednesday May 25, 2011 @03:07PM (#2585114)
There's also the issue of all the ephemeral garbage Clojure tends to create and gets disposed. Not sure if 1.3 generates less but oh a phone that stuff adds up.
Re:C'mon, stop writing Java for Android by sbochins on Wednesday May 25, 2011 @06:16PM (#2585773)
I thought there were some GC optimizations needed to make it work efficiently on android. I was under the impression it worked ok for Android 1.2 phones and up.
Re:C'mon, stop writing Java for Android by technomancy on Wednesday May 25, 2011 @06:41PM (#2585855)
> I was under the impression it worked ok for Android 1.2 phones and up.

It works OK in the "You can run a repl on your phone if you don't mind waiting a few seconds" sense. That's a far cry from "You can build a usable application with it."