Riju currently says ReasonML has no REPL. That's not fully true--technically, ReasonML does have a REPL named rtop. What is true is that BuckleScript, the OCaml-to-JS transpiler that is most often used in conjunction with ReasonML, doesn't provide an interactive/REPL interface, so ReasonML/OCaml in the JS runtime has no REPL (see #48 for a more thorough discussion of the various runtimes for ReasonML/OCaml). So rtop only runs via the native runtime and does not provide any access to the JS bindings provided by Bucklescript.
Here are three options to setting it up (there may be more):
Via OCaml's official package manager opam. OPAM needs to be first initialized with opam init before anything is installed, as you're probably aware; after that, running opam install rtop will install the rtop executable to <opam_switch>/bin/rtop (where <opam_switch> is most commonly ~/.opam/default).
Via Esy, which, as far as I can tell, is geared towards the native ReasonML runtime and therefore comparable to OPAM but provides a more npm-esque tooling interface and adds access to NPM-hosted OCaml native packages. It itself needs to be first installed via npm install -g esy; then, rtop can be installed via either esy add reason-cli (alias to NPM package) or esy add @opam/rtop (alias to OPAM package). I'm not sure whether using Esy adds much value to the Riju use case, but I'm putting this approach here as reference anyway.
imported comment by @kwshi
Riju currently says ReasonML has no REPL. That's not fully true--technically, ReasonML does have a REPL named
rtop
. What is true is that BuckleScript, the OCaml-to-JS transpiler that is most often used in conjunction with ReasonML, doesn't provide an interactive/REPL interface, so ReasonML/OCaml in the JS runtime has no REPL (see #48 for a more thorough discussion of the various runtimes for ReasonML/OCaml). Sortop
only runs via the native runtime and does not provide any access to the JS bindings provided by Bucklescript.Here are three options to setting it up (there may be more):
opam
. OPAM needs to be first initialized withopam init
before anything is installed, as you're probably aware; after that, runningopam install rtop
will install thertop
executable to<opam_switch>/bin/rtop
(where<opam_switch>
is most commonly~/.opam/default
).reason-cli
npm package.npm install -g esy
; then,rtop
can be installed via eitheresy add reason-cli
(alias to NPM package) oresy add @opam/rtop
(alias to OPAM package). I'm not sure whether using Esy adds much value to the Riju use case, but I'm putting this approach here as reference anyway.