Comment by dmjio
1 day ago
https://github.com/dmjio/miso-lynx
Building native applications for iOS, Android and Huawei devices in Haskell.
1 day ago
https://github.com/dmjio/miso-lynx
Building native applications for iOS, Android and Huawei devices in Haskell.
This sounds very interesting. You say “native” but miso generates JavaScript, right? I’m not familiar with mobile development. Can you run JS natively on mobile devices?
Yes, miso uses the JS backend in GHC, and mobile phones have embedded JS interpreters (e.g. JavaScript Core). These interpreters can access native libraries to draw native views, or access native device APIs.
Projects like lynx and react-native automate this process using something akin to node-gyp, exposing kotlin / swift libraries via C ABI w/ a JS API. Miso accesses the kotlin / swift native modules by FFI'ing into the JS that exposes them.
The JS doesn't get compiled, but on Android it does get JIT'd. So it's "native" in the sense that the views drawn are native (not WebViews), and the device APIs are native, but not "native" in the sense that it's compiled.
That is very interesting. I never knew that JS could access native APIs. That's very promising for compilers that can generate JS, like GHC!