How to install ocaml on Mac

help

#21

If you want to play with the language, I would recommend:

opam install utop

which will install a very nice interpreter for ocaml. Then you can do:

utop

and start typing in OCaml expressions:

utop # 1 + 4;;
- : int = 5

For compiling OCaml applications I would recommend the dune build system.


#22

See also: https://dev.realworldocaml.org/install.html


#23

If you just want to see if your OCaml toplevel is working you can do a quick test from the terminal:

$ ocaml
        OCaml version 4.06.0
# 1 + 4;;
- : int = 5
# exit 0;;
$

(The ;; token tells the toplevel to evaluate what you’ve typed since the last evaluation.)


#24

hi, can you help me? I use Mac with the system 10.13.6. But I can’t install Graphics package, how can I install it? I have tried lots of methods, but failed…thanks