4 ms·
It's been a few months since I messed with it so it might not be as bad now, but the main problem for me was that Clojure on Android is slooowwww. This is mainl
by astine 15y ago
It's been a few months since I messed with it so it might not be as bad now, but the main problem for me was that Clojure on Android is slooowwww. This is mainly in terms of startup. You have to include the Clojure runtime with any programs you write with it and this is a substantial overhead on Android. Your binaries will be larger as a result as well. This is because, Clojure as a Lisp, expects the entire language to present all the time. This usually is the killer feature (it's a large part of what makes macros and the dynamic coding associated with Lisp possible) but it's a pain when you have limited resources.
The other issue I ran into was that there were issues in getting Clojure to interact with Android properly. Android requires that you compile your code into classes which means you will have to use :genclass in Clojure and implement a lot of interfaces. This in itself isn't that much of a problem (it will make you code less Lispy but oh well) but when I tried it there were bugs in Clojure which made it impossible for me to do some things on Android that I would have liked. That part of the language runtime is a little immature in my experience.
I wouldn't give up based on my words though. It may have improved since I last tried. If you want to look someplace for info on how to get started, I found that this fellow has a lot to offer: http://www.deepbluelambda.org/programming/clojure/creating-android-applications-with-clojure http://www.deepbluelambda.org/programming/clojure/creating-a...
- wccrawford 15y agoAh... That 5-10 second load time is a deal-breaker. Thanks for the info!
- pvarangot 15y agoIf I were you I would still try it. I'm a little behind on my personal projects but I'm definitely trying Clojure on Andriod this month. I've seen toy Clojure apps running on Android 2.2 and they took sensibly less than 5-10 seconds to load. I'm mentioning this since parent doesn't specify which Android version he was using, and JIT compiling was only recently introduced in 2.2.