Making OCaml Accessible and Learnable for More People

I feel your pain brother Kevin. I’m a programming enthusiast and I love Ocaml but I always reach a point in OCaml where I hit a wall and all the explanations to break through that wall are -> see academic paper. See academic paper is great if you have a formal/graduate background in computer science but to an enthusiast its a keep-out sign.

1 Like

Don’t underestimate the power of a good story to get people interested in a language. There are several testimonials from Jane Street on how they use OCaml to prevent themselves from imploding. I found these super fascinating, but in my prosthelytizing about the language people dismiss JS’s use case as fanciful and esoteric stuff only of interest to quant traders. Not too far from other critiques about how OCaml is just esoteric fluff that’s only of interest to PL PhDs for writing compilers.

Most programmers don’t write trading bots, or compilers. They don’t care one bit about GADTs. They don’t even care about monads (:scream:). Most programmers work on mundane stuff, like CRUD frontends.

OCaml makes this unsexy stuff easy too. Being able to write OCaml for a trading bot is nice, but where it really feels like a good friend that’s got your back is when you’re doing something soul crushingly boring, say, like compliance archiving or a mailing list subscription manager.

More testimonials from normal people about how OCaml makes the easy things easy (along with the hard things possible) would do better to communicate that this is a language for the masses.

11 Likes

A very compelling example of this is Thomas Leonard’s series of blog posts on moving 0Install from Python to OCaml.

More examples/testimonials would good. I’ve presented my own work on moving to OCaml and the benefits it’s brought (most recently at the annual Tcl/Tk conference last week), but haven’t published anything yet.

4 Likes

Humm, I don’t agree with you. I started a month or two ago and I find this learning experience fun, just like undergraduate and graduate math was cool at the time. ML is just another math dialect. Before that I randomly learned D ( dlang, a simplified (in the sense cleaned) C++ lab) but I rejected it. Searching, naturally brought me to OCaml/F# (and others). Dude, it was "math at first sight ", what a relief honestly for my brain. It’s like I can rest on my laurels and breath again through pages and pages. Don’t get me wrong, it’s not easy, I got to work, I think long hours, I don’t understand right away at all, week later sth forms, then bam epiphany. And I like that, my heart with pleasure fills.

Also, I think your comment is not related to OCaml. Hereafter comes the part I think is completely wrong “Making OCaml Accessible and Learnable for More People” (that is actually, the title). I develop my points on this assertion.

Please a maintainer, review the following for it is only neutral (no interpretation attached nor possible). It is a mathematical embedding, if alone.

i) People join groups. There is one elementary operator of interest here, set theoretic inclusion. Either you feel like you belong or not. That’s how group forms.

ii) OCaml is a group of academics or fallen ones, called engineers (like me). There is indeed 3 major sets out there . Schools(teachers/researchers), industries(engineers), benevolents(free/open source/github). 3 knowledge economies.

iii) OCaml community is doing research on functional languages and make money at Jane street. They write toy programs of highly educated bits. Your are at a border of science and industrial tooling here. (review this please, I am too new to know you guys)

iv) Your complaint says “please can you redefine your group to be like this other group” . It partly says “dumb it down”. When I read ML code there is inherent clarity already. Yes, when it is relevant, documentation is welcomed. it is up to the author to judge its necessity for its peers.

v) tiny communities write single handedly, expect wild variation in documentation (basically based on character and time allocated).

vi) ocaml has educated members why write themselves beginner’s guide ?

v) easy (yet clear) doesn’t exist. Take monads, a canonical case of “Ho, I got it, let me tell you in one metaphoric image in under a minute” + “can be shown easily if only was explained better”. No. Just NO. Learning takes a bloody long while. You need to do exercices, work an implicit model, maintain a wide cognitive load in place and gather all pieces (none missing by minimality) to reach epiphany ready state (you feel it takes an effort to trigger next step), then compactify this large intricate object into an implicit model. Then a student asks you or you have to explain to a colleague and a second stage of semantic compression runs to get clarity (by explicitly laying abstractions, say brain re-factoring). This is the intuition we all listen to but don’t actually understand (since it is a complex mental object residual). (unless the intuition is a morphism of a structure we are familiar with, it has to be build axiomatically as a standalone thing). This dude explains physics like it’s trivial. He deeply understands it, and I get his finely laid explanations but I can’t make, create, solve physics after that. Takes the years it took him. And I won’t ever be a physics dude, they have another mind set as mine. You can’t just learn anything.

I don’t see how ocaml is not accessible for beginners. I am one example of a happy beginner. It is not accessible for any beginner. see i). OCaml starts rather gently with simple ideas (lambda calculus, functions etc) bundled in a lightweight syntax (arrows, let , let in…). It prints types like program shapes. really helpful. “made for me”.

Besides, with git, if there are holes, it’s a good exercise to plug and room for you to contribute. I plan to write and share my learning while closing gaps I may come upon.

vi) a community is always welcoming to whom is akin to (pertaining peers). see i) law.

v) on youtube, you can get numbers on group sizes. This mini math trivia. 3779 views for a recreational upload. If you count, there is like 1 in 10 000 people with mathematical brains. There is 10 millions github cumulated users. Back-of-the-enveloppe Fermi estimation gives 1000 OCamls (by hypothesis). Jane street has 900 employees + academics who are negligeable (in number ofc). So OCaml community is already full. There is no such thing as " getting more wide traction". You can weaken a property to merge/include a group in another group. I think OCaml rocks ! And when I want to play with monads I go away to Haskell.

vi-a) ReasonML puts on cosmetics to bond with JS folks(physically alluding to their syntax). You basically say in the title " please be this group, be like them". ReasonML was born to your literal will. You can join their community for they comply to your likings. They do all the concrete examples you mention. Can’t get more real. There were born from this very post title specs : OCaml for the masses.

vi-b) They want popularity. Popularity = lowering to common denominator = removing GADT (for example) and from one hard thing to another hard thing eventually get to JS or talk pointers with hardware. I don’t want that. Also, everything is available and accessible. Polymorphic variants is nicely introduced in papers by Boris Yakobowski.

vii) all groups are open and welcoming to whom they define by an inclusion operator. Very loosely put, OCaml is an equivalence class of the quotient set of programmers by binary “befriend” relation. see i).

viii) I concur with @UnixJunkie who nails it haha :

viii) there are very easy, clear books assuming beginner’s level from Weis/Leroy, Cousineau/Mauny (who write a caml compiler in a turing machine by lowering to assembly code, all of which is hand made from scratch), RWO, and programs out there is plenty to read.

ix) to make a long story short there is no such thing as “making it easy” either. You can just make it "clear, clean, nicely put " which is by nature what you get with ocaml.

I totally agree with the spacial mention. Being able to move around rapidly is very important.

Personal note : I chose OCaml for its academic foundations and no 5 yo reads. I don’t want to read vacuous text of too low entropic value. F# is another OCaml with beginner friendly doc and has many papers of academic standards. See their wikibooks and the verbose/ligthweight syntax. In particular their reference guide is easy peasy, and there is a vanilla soft intro to F#/OCaml here(gitbook) or here(blog) from Scott Wlaschin. It goes very slowly, it’s made for beginners, it’s highly pedagogical, I read it all for the sake of educational enlightment and it even has monads explained without noticing it. He takes your hand all the way.

PS : I replied to the title in its exact formulation.