Skip to content

wishlist: foreign import javascript, JSVal #217

@dmjio

Description

@dmjio

Per emscripten's documentation, it should now be possible to support calling into JavaScript. This might require creating a primitive type like JSVal, similar to what the new WASM / JS backends in GHC have.

https://ghc.gitlab.haskell.org/ghc/doc/users_guide/wasm.html#marshalable-types-and-jsval

foreign import javascript unsafe "alert" alert :: JSString -> IO ()

desugars into something like

EM_JS(void, call_alert, arg, {
  alert(arg);
});

This should allow us to build iOS and Android applications w/ MicroHS using JavaScript.

dmjio/miso#864

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions