Comment by dmjio
18 hours ago
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!