4 ms·
(Inspired by this post,) I gave the official ocaml tutorial a whirl. I quite enjoyed the syntax, and the easy install (of opam). However, I thought I should me
by ttymck 5y ago
(Inspired by this post,) I gave the official ocaml tutorial a whirl. I quite enjoyed the syntax, and the easy install (of opam).
However, I thought I should mention that I got _exactly_ as far as [0] (found while trying to google a solution) before giving up. The REPL is great, but if I can't compile easily, it doesn't inspire the confidence needed to go any further.
[0] https://news.ycombinator.com/item?id=7418543 https://news.ycombinator.com/item?id=7418543
- WastingMyTime89 5y ago[0] is a post from seven years ago where the poster installed ocaml using the Debian package manager rather than through opam as recommended and failed to use a core library because they didn't understand the admittedly strange way Debian packages Ocaml. You probably shouldn't use Debian packages for Ocaml (nor for anything else admittedly - Debian has terrible habits regarding patching and splitting). The community actually standardized its way of compiling around Dune which is very good.
- ttymck 5y agoYes, it was uncanny that I was led to a seven year old post, trying to follow the currently available "a first hour with ocaml" tutorial [1] [1] https://ocaml.org/learn/tutorials/a_first_hour_with_ocaml.html https://ocaml.org/learn/tutorials/a_first_hour_with_ocaml.ht...
- Zababa 5y agoThere is a relatively new page to install OCaml that works really well (on Linux at least) https://ocaml.org/learn/tutorials/up_and_running.html https://ocaml.org/learn/tutorials/up_and_running.html. As the sibling mentionned, compiling is mostly done through dune https://github.com/ocaml/dune https://github.com/ocaml/dune
- ttymck 5y agoIt appears I unwittingly skipped a step, misled by the title "a first hour with ocaml" [1]. Thanks for the tip on dune. [1] https://ocaml.org/learn/tutorials/a_first_hour_with_ocaml.html https://ocaml.org/learn/tutorials/a_first_hour_with_ocaml.ht...
- yawaramin 5y agoWhich 'official OCaml tutorial'? The only one I can find is the 'Up and Running' one that someone else posted, and that uses the modern toolchain with opam and dune which would prevent you from running into the error described in the 2014 comment.
- ttymck 5y agoI guess I skipped "up and running" and opted for "a first hour with ocaml" [1] In my defense, [1] makes no reference to dune, which I am excited to try out. [1] https://ocaml.org/learn/tutorials/a_first_hour_with_ocaml.html https://ocaml.org/learn/tutorials/a_first_hour_with_ocaml.ht...
- yawaramin 5y ago'A first hour with OCaml' says, at the beginning: > You may follow along with this tutorial with just a basic OCaml installation, as described in Up and Running. So, you can't really skip 'Up and Running'. And, the Graphics module usage is in the section 'A module from OPAM', which explicitly talks about installing the package and then loading it in the REPL ('top level').