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

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
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
TwistingTwists
This is my Journal for readings on Designing Elixir Systems with OTP. Will post chapter 01 tomorrow! Stay tuned!
New
ggarnier
In Aborting Multiple Fetch Requests with One Signal section, the code in abort/abort_ex09.js doesn’t show the downloaded images until Pro...
New
adamaiken89
Anyone is interested in a classical textbook for algorithms can go and check that.
New
AstonJ
With Tailwind now the default CSS framework shipped with Phoenix we thought it would be nice to run this book club on the Elixir Forum. ...
New
PragmaticBookshelf
When the pandemic, heart disease, and personal tragedy threatened to steal everything the Tates spent years building, they found hope, he...
New
Fl4m3Ph03n1x
Learning Domain-Driven Design Building software is harder than ever. As a developer, you not only have to chase ever-changing technologic...
New
alvinkatojr
https://fs.blog/mental-models/ I’ve been reading Farnham Street for a while, and this topic is the recommended starting point for new re...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New