Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the preferred way to use clojure for making a mobile app (Android and IOs versions)

I've already seen that there are a few tools to build mobile apps from clojure but i would like to know more details about libraries, environment, drawbacks, profiling and real working examples

Thanks

like image 779
tangrammer Avatar asked Jan 23 '14 15:01

tangrammer


2 Answers

Using ClojureScript with React Native is now becoming a great answer to this question:

  • Performance of React Native is great.
  • Existing React libraries like Om and Reagent work with React Native.
  • You can benefit from “learn once, write anywhere” knowledge reuse.
  • You benefit from using a stack and language that have significant communities behind them.

And the most compelling reason: React Native allows you to write mobile apps using ClojureScript's strength as a functional language, avoiding the imperative style, mutation, and statefulness.

like image 115
Mike Fikes Avatar answered Nov 09 '22 00:11

Mike Fikes


So far, here is my investigation result:

To create native mobile apps I've found 2 lein plugins available:

  • Native android: lein-droid. Let's you compile, deploy, install and live repl with usual lein commands [lein droid doall, lein droid install, lein droid compile].
  • Native iOS: lein-fruit. A Leiningen plugin for building native iOS apps in Clojure and Java using the RoboVM bytecode-to-native translator.

There is also another interesting way to build an iOS app in the same way that works clojurescript to obtain javascript. In this case from clojure to scheme to C with clojure-scheme

And on irc #clojure channel, David Nolen and others suggest the following paths:

[6:27pm] dnolen: tangrammer: w/ iOS you'll have better luck with the JavaScriptCore bridge and ClojureScript  
[6:27pm] dnolen: tangrammer: I've tried it works great and I know other people are experimenting with it as well  
[6:28pm] dnolen: tangrammer: it does limit you to iOS 7, but you could take the Ejecta approach for earlier OSs
[6:38pm] dnolen: tangrammer: core.async on iOS works great
[6:38pm] dnolen: tangrammer: you can also do multithreaded CLJS on iOS
like image 44
tangrammer Avatar answered Nov 08 '22 22:11

tangrammer