How can I install use OCaml and Reason/Bucklescript?


#1

I’m new to Reason and after hacking away in it for a few weeks I would really like to start learning OCaml.

I started following the installation instructions from the 2nd edition of Real World OCaml and I ran into a potential issue that I’m not sure how to solve.

  1. Configuring OPAM, it seems like this is already configured but I’m not sure if the Reason defaults are compatible and I’m also unsure if using opam init would mess up my current config.

  2. Compiler version… they want 4.06.0 but I seem to have 4.02.1 C 4.02.1 Official 4.02.1 release. My concern if figuring out how to switch back to the 4.02.1 when I want to use bucklescript/reason again. Is it really as easy as running switch 4.02.1?

Basically, I just want to follow the book but I don’t want to bork my environment while trying to learn a little OCaml. I’ve done similar things without haste and it’s always bitten me :laughing:


#2

Hey. What method did you use to install Reason? and opam should takes care of that. You just run opam switch 4.02.3+bucklescript-master (or something like that) to swtich back to Bucklescript’s required compiler version


#3

Thanks! I can’t wait to try it out. I used NPM to install bsb globally.


#4

hmm. In that case, I don’t see any problem with installing opam along side at all. :smiley: happy hacking with OCaml.