4 ms·
ClojureScript + React Native would produce a native app.
by mateuszf 11y ago
ClojureScript + React Native would produce a native app.
- pjmlp 11y agoNo because they run on a JavaScript container of some sort.
- hellofunk 11y agoThat's not entirely true. React Native does indeed run on the native device, not in a JS "container". The JS part is a bit of glue code. In the case of iOS for example, React Native uses the same exact UI toolkit that runs natively on the iPhone as if you have written it in Swift or Objective-C. Apple's JavaScriptCore exposes the native elements with a JS api, but they are not running inside JS. Only a minor part of the glue is interpreted as JS, and it's not usually the CPU-intensive stuff.
- pjmlp 11y agoOnly if you are speaking about iOS. I only care about Android and Windows Phone/Store.
- logicdispatch 11y agoIt's not any different than Clojure and ClojureCLR running in a "container of some sort". Clojure and ClojureCLR are libraries that add embedded support to the JVM and CLR to execute Clojure code and interop with the "native" environments there. JavaScriptCore is an embedded JavaScript runtime that provides essentially the same thing for JavaScript <-> Cocoa. You have full access to native Cocoa APIs. (Similar to Rhino or Nashorn if you are more familiar with the JVM.) You use native widgets (e.g. UITableView), not web/dom widgets. This is a different thing than Cordova, et al, that essentially run a webview with some native functionality surfaced to the dom. This is what React Native uses, and I thought I had seen some people experimenting with using ClojureScript and JavaScriptCore.
- pjmlp 11y agoClojure -> Java Bytecodes -> Dex Bytecodes -> Native code (Dalvik-JIT / ART-AOT) => No FFI, direct access to native APIs ClojureCLR -> MSIL -> AOT compilation via MDIL and .NET Native => No FFI, direct access to native APIs ClojureScript -> WebView (whatever it uses to execute JavaScript) + writing JavaScript bindings by hand for webview access I don't care about JavaScriptCore as only have access to Android and Windows Phone devices. Plus it is already enough having to deal with JavaScript toolchains when customers request webdev projects.
- mateuszf 11y agoReactNative with ClojureScript would not use a webview, but native components (at least on iOS)