mafinar

mafinar

My OCaml Journal

I am going to dump my thoughts, methods, codes, experiences and rants while learning OCaml into this thread.

This is probably the 5th or 6th time I am attempting to learn an ML, in the past I tried out Reason, OCaml, F# and discontinued for unknown reasons, I don’t remember having any roadblocks or complaints, perhaps laziness. There is no guarantee this will continue either.

I am keeping the documentation and Real World OCaml as primary source of education. The posts will be on a Day <n>: <Place an angry title here> format.

Most Liked

yawaramin

yawaramin

Author of Learn Type-Driven Development

Hi Mafinar, I would recommend my post to get started: Practical OCaml - DEV Community . It walks through setting up with a few common libraries.

I don’t actually include Jane Street’s Core/Base because I usually don’t reach for them. That’s one of the, in my opinion, issues with Real World OCaml: it very heavily relies on and presents Core as ‘the alternative standard library that everyone should use’ when in reality it’s a very heavyweight dependency that usually only large applications can justify. It’s also not ported to Windows (same with Jane Street’s Async, which is why I recommend Lwt for concurrency).

I think it’s a good idea to start with the libraries that are shipped with OCaml:

  • core library (note, not Jane Street Core), this lists the built-in types and exceptions of the language
  • standard library (Stdlib), this provides a lot of functionality, especially in recent OCaml versions. Especially important: List, String, Set, Map, Hashtbl, Printf. Also look into Sys (e.g. Sys.getenv) and Filename (file name operations, portable directory separator, etc.)
  • unix library (Unix system calls), the name is a slight misnomer as it also (mostly) works on Windows.

So that leaves the final note–instead of Real World OCaml, I would actually recommend Cornell’s Functional Programming in OCaml, which is based on their lecture notes for their course, with a long history of teaching OCaml (and doesn’t rely on any alternative standard libraries).

By the way, I am enjoying this thread a lot and will be happy to jump in as well if any questions :slight_smile:

OvermindDL1

OvermindDL1

I’m looking forward! ^.^

If you have questions about OCaml or so, don’t hesitate to ping me. ^.^

dimitarvp

dimitarvp

Same. Looking forward! I have started and stopped several times during the last year. There’s always something missing.

Last time I was pretty close to daily productivity however. I learned esy, a builder for OCaml, and was able to also use the LSP (merlin) to check for errors in my Emacs, plus to auto-format code.

Where Next?

Popular Community topics Top

Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
finner
As one of my New Year resolutions is to read more tech I’ve decided on an attempt to document my travels in Mannings Modern Java in Actio...
New
Tommy
So I have enough money to last a year. Realistically I’m still going to have to work part time painting. I’m so done with it though! I h...
New
mafinar
I am going to dump my thoughts, methods, codes, experiences and rants while learning OCaml into this thread. This is probably the 5th or...
New
mafinar
TL;DR I am reading “Domain Modeling Made Functional” and discussing and keeping a journal of what I learned from it, any co-readers welco...
New
TwistingTwists
I have read first chapter. Will add my notes / code tries / self exploration as I go along! Thank you @AstonJ for encouraging to start ...
New
ohm
I would love to begin a book club with Mike Amundsen’s (@mamund) book Design and Build Great Web APIs. It seems that building new syste...
New
rgerardi
Hello all. Creating this space here for general discussion and chat about Powerful Command-Line Applications In Go In particular, we ca...
New
AstonJ
With AI set to play a big role in our industry Elixir users are lucky to have Nx, so we’re running our Nx related book club on Genetic Al...
New
AstonJ
With Phoenix and LiveView having recently had a fairly major release, and Programming Phoenix LiveView being updated too, we thought it w...
New

Other popular topics Top

PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New