使用clojure制作移动应用程序(Android和IOs版本)的首选方法是什么?

tan*_*mer 7 clojure clojurescript

我已经看到有一些工具可以从clojure构建移动应用程序,但我想知道有关库,环境,缺点,分析和实际工作示例的更多细节

谢谢

Mik*_*kes 12

使用ClojureScript和React Native现在成为这个问题的一个很好的答案:

  • React Native的表现很棒.
  • 像Om和Reagent这样的现有React库与React Native一起使用.
  • 您可以从"学习一次,随处写"知识重用中受益.
  • 您可以使用具有重要社区的堆栈和语言.

最令人信服的原因是:React Native允许您使用ClojureScript作为函数式语言的强度编写移动应用程序,避免命令式样式,变异和状态.


tan*_*mer 6

到目前为止,这是我的调查结果:

为了创建原生移动应用程序,我发现了2个可用的lein插件:

  • 原生android:lein-droid.让我们用通常的lein命令编译,部署,安装和实时repl [lein droid doall,lein droid install,lein droid compile].
  • 原生iOS:lein-fruit.一个Leiningen插件,用于使用RoboVM字节码到本机转换器在Clojure和Java中构建本机iOS应用程序.

还有另一种有趣的方法来构建iOS应用程序,就像使用clojurescript获取javascript一样.在这种情况下,从clojure到方案到C与clojure-scheme

在irc #clojure频道上,David Nolen和其他人提出了以下路径:

[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
Run Code Online (Sandbox Code Playgroud)