3 ms·
> This does mean you have to jump through a number of hoops to use FFI. TBH, I thought the pain of FFI in ports (the only mechanism available in Elm 0.19) was
by piaste 5y ago
> This does mean you have to jump through a number of hoops to use FFI.
TBH, I thought the pain of FFI in ports (the only mechanism available in Elm 0.19) was kinda overblown. Function input goes into a command, function output comes back as a message. That's just a few extra lines of standard code.
I think they become annoying if you do lots of small, synchronous, safe calls, like using a JS math library. In that case I suspect I would prefer writing a larger JS function instead of having an Elm function full of JS calls, even if I could use a more permissive unsafe FFI, because every JS invocation is still a chance at runtime errors due to type conversions (even with ports).