logoalt Hacker News

sheepttoday at 4:19 PM1 replyview on HN

In Elm 0.19, they removed the ability for third party packages to provide native bindings for JavaScript APIs that the language or its official packages didn't yet support.[0] The only alternative proposed by Evan is to use ports, which are about as ergonomic as calling a function in a web worker.

[0]: https://discourse.elm-lang.org/t/native-code-in-0-19/826


Replies

1-moretoday at 8:11 PM

there is also web components (best way to do a "copy this to clipboard" button in my experience) and secret back door synchronous FFI through overloading the Object prototype. In all cases the communication is gated through decoders/encoders that can fail; you can only pass serialized data across the boundary from JS to Elm.