2 ms·
> I can use Esy to write native OCaml/Reason, but has no use in a compile-to-js environment - there it is npm/yarn. If you use js_of_ocaml (a compiler from OCa
by andreypopp 8y ago
> I can use Esy to write native OCaml/Reason, but has no use in a compile-to-js environment - there it is npm/yarn.
If you use js_of_ocaml (a compiler from OCaml/Reason to JS) then esy works with it very well (with the help from dune). With Bucklescript (another OCaml/Reason to JS compiler) it's more complicated (see below).
> With Esy I will be using Dune as my build tool, but instead of the opam binary I can use Esy itself which can pull packages from the opam repository. It takes care of both packages and compiler environment just like opam.
This is correct!
But not necessarily dune (though this is a very good choice), you can use almost any build system you want.
> Is there anything in Esy that would make porting native OCaml packages (like say https://github.com/c-cube/qcheck https://github.com/c-cube/qcheck) to Bucklescript?
Unfortunately not, esy works on level higher than build systems, it doesn't built code itself but rather calls an actual build system to do the workd (dune, make, cmake, ...). Bucklescript is unique as it tries to own the whole stack and thus you have to make code compatible with its build system (bsb) manually.
One thing which esy could help though right now with Bucklescript is providing native tools like ppx'es (preprocessors for Reason and OCaml code) or tools for editors like Merlin (autocompletion and etc.).
> It would also be wonderful to see it in action through a short video tutorial.
Agreed. Hope to have something soon.