It’s Javascript typed bindings are just done via OCaml’s normal FFI system, it just all fit very well. ![]()
But yeah, I’d probably do something similar in Elixirscript. Last I saw Elixirscript you still did the JS.import bit (though now removed according to your just-now changelog ^.^), I’d probably do something like:
defjsmodule Underscore, import_name: "_" do
deffun blah/2
end
Or whatever, although you could add typing information like I’m doing in TypedElixir so you can cause compile-errors when interfaces are mis-used. ![]()
But yeah, OCaml’s FFI is just typing the interface, which the compiler then resolves to JS modules, it is very succinct and powerful and safe, as well as hard to borrow without having types in Elixir. ^.^


















