Reason native and ocaml libraries


#1

Hi all,

I’ve been playing around with reason (native installed with opam). From the docs I was under the impression that reason is just a syntax on top of ocaml’s ast and so interop (in the native case) should be seamless. In general I have found that this is true but there are several that give me errors when I try to #require them in rtop. The errors returned are not very informative, i.e. syntax error message. For example:

Reason # #require "owl-top";
Exception: Syntaxerr.Error(_).
Exception: Syntaxerr.Error(_).
Exception: Syntaxerr.Error(_).

Anyways, I’m just curious if interop in native reason with ocaml should be as straightforward as I was assuming.

Thank you,
Jason


#2

I have found the following work-around:

bash # utop-full
utop # #require "owl-top";;
utop # #require "reason.rtop";;
Reason # open Owl;

which then works as expected. So it would seem that the answer to my question is yes there is seamless interop. Not sure though why requiring directly in rtop fails.

Cheers,
Jason