Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a nice, complete and well-documented review of why Clojure is not made for Android.

I disagree with the conclusion though: yeah, the classic JVM-clojure seems doomed on Android. Why ? It's not made for that, it's made for servers, it's not even used for desktop GUI programming that much. Even if we beat the startup time, it's not likely that we'll get nice UI-bindings for Android before a long time (I like the Java-interop but writing serious Android apps with the interop alone seems awful to me) and yes, there are some libraries abstracting this a little bit such as neko [1] but it's still too close to the Java-development paradigms (it's not as clojure-ish as I wish, but that's my opinon!).

So, the conclusion: no we don't need a swift for Android, and clojure is not swift anyway.

iOS already has clojure support, it's not really stable but it has decent startup times and a nice API. It's not the JVM-clojure, it's clojurescript. The UI is managed by React Native and om. It works and you get a nice REPL running too. [2] No it's not finished and has lots of bugs and it's not even publishable on the AppStore for now but it's just a matter of weeks here before addressing those problems (you can follow the work of David Nolen & Mark Fikes on this particularly, they often communicate on what they're doing but there are other awesome people working on this too!)

So for Android ? ReactNative is coming too [3]. When it's there, the community will try the same thing as what they did on iOS, and it's likely to succeed too. The community behind cljs is growing and it's becoming the main clojure implementation for ui-related stuff. You can thank React and om for that but I think that core.async has a lot to do with it too.

Anyway, I don't want to stop believing in Clojure for mobile development.

[1]: https://github.com/clojure-android/neko [2]: https://github.com/omcljs/ambly/wiki/Driving-React-Native-wi... [3]: https://facebook.github.io/react/blog/#when-is-react-native-...



> So, the conclusion: no we don't need a swift for Android,

I think we do, and to me, that language is Kotlin:

Analysis: http://goo.gl/wNjXoU

The language: http://kotlinlang.org


Kotlin also looks like the most serious contender to me. Sure, something like Rust might be more interesting for various reasons, but the engineering effort needed to port the Android framework to another language would be huge (and the official word from the Android framework team is that it is not worth the effort). Not to mention that third party developers would have to relearn the framework from scratch and that we either have a windows mobile 6 / WP7 rift or the framework team has another nightmarish problem to solve. Kotlin looks like it could both guarantee retro-compatibility with Dalvik and brings a better language to the platform.


Totally agree with you! Kotlin is great replacement for Java on Android. I like to see that more and more interesting libraries appear for Kotlin, like Anko. I recently made Anvil compatible with Kotlin (http://zserge.com/blog/anvil-kotlin.html), which makes UI development a pleasure


Just a few thoughts:

1. Clojure is a general purpose programming language. Just because it isn't used much for desktop GUIs doesn't mean it's not usable for that. What percentage of Java/Scala development is used for GUIs?

2. Clojure in iOS isn't just available via ClojureScript. There is also RoboVM, though it doesn't support REPL-driven development, if I understand it correctly.

3. I am very interested in what React Native can do. For me, the key questions about using it are: Can you create applications that fit will into the UX idioms of the host platform? What happens when something goes wrong? Do the various levels of indirection make debugging much more difficult? Do you still have access to the full platform? If not, then only certain classes of applications can be implemented using React Native.


> So, the conclusion: no we don't need a swift for Android, and clojure is not swift anyway.

At very minimum we need Java 8, but I am willing to bet Google IO will not bring any news on that front.

Currently I have been using Java/C++ for my mobile hobby programming as I also like to play around with WP (C++/CX).

Regarding Clojure, maybe a static Lisp with Clojure syntax but with type inference could be a way to tackle the problem.

It wouldn't be pure Clojure, but maybe good enough.


Maybe Pixie-Lang with the NDK. You would have to wrap all the Java GUI calls through their C interface. This sort of messes with my head a little.


Very highly unlikely. With the NDK, you lose 99.9% of the framework. Any replacement language for Android needs to interface with Android's java framework or it will be completely useless.


Last time I checked, pure NDK apps are best for games that use OpenGL as their primary interface. If you want native controls, you can't really do that entirely from the NDK side.


It is still the case.

So far I have endured the NDK because I cared more about playing around with graphics between Android and WP on my hobby coding.

Something like Qt allows for native like controls, but one is loosing the functionality the platforms offer for free, as well as, increasing the APK size considerably. And JNI wrappers are still required for interacting with the OS for intents and such.

From the JVM languages Clojure would be a good candidate for staying in Android user space and also allow targeting iOS (RoboVM) and WP (Clojure-CLR), specially with the help of the upcoming reader conditionals.

But with this performance, Xtend, Kotlin and Scala appear to be better candidates if one is just focusing on Android.


I've been using Phonegap with Clojurescript on iOS. Perhaps that would be a viable alternative for Android development as well.


It is certainly doable. I haven't done it myself, but I know of people who have done it successfully on Android.

Unfortunately, I don't think Phonegap is a very good solution. Depending on your application, it may be good enough, but it's overall not as good as true native development.


It is not. Not as a general purpose solution anyway. Phonegap can be useful in order to quickly publish a very simple application on both platforms. Outside of that, its disadvantages pile up VERY quickly.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: