Learning OCaml will teach you the languages and concepts of the next 5 to 10 years of mainstream programming languages. E.g., here's a TC39 proposal to add declarations to conditionals: <a href="https://github.com/tc39/proposal-Declarations-in-Conditionals" rel="nofollow">https://github.com/tc39/proposal-Declarations-in-Conditional...</a><p>It says, in the 'Future Work' section:<p>> This could be extended to allowing multiple names to be initialized (such as through destructuring) with a "normal" conditional to be written after the assignment with a ; (similar to a for).<p><pre><code> if (let x = 1, y = 2; x || y) {
/* ... */
}
if (let {x, y} = data; x && y) {
/* ... */
}
</code></pre>
Meanwhile, OCaml from day one:<p><pre><code> if let x = true in let y = true in x || y then
...
if let { x; y } = data in x && y then
...</code></pre>
Past threads related to this book:<p><i>Functional Programming in OCaml</i> - <a href="https://news.ycombinator.com/item?id=22408664" rel="nofollow">https://news.ycombinator.com/item?id=22408664</a> - Feb 2020 (58 comments)<p><i>Functional Programming in OCaml</i> - <a href="https://news.ycombinator.com/item?id=22400233" rel="nofollow">https://news.ycombinator.com/item?id=22400233</a> - Feb 2020 (1 comment)<p><i>Functional Programming in OCaml</i> - <a href="https://news.ycombinator.com/item?id=19292067" rel="nofollow">https://news.ycombinator.com/item?id=19292067</a> - March 2019 (144 comments)
There is a video playlist by Michael Clarkson which has been released recently too.<p>He is a pretty good communicator!<p><a href="https://www.youtube.com/playlist?list=PLre5AT9JnKShBOPeuiD9b-I4XROIJhkIU" rel="nofollow">https://www.youtube.com/playlist?list=PLre5AT9JnKShBOPeuiD9b...</a>
I’ve been working on an OCaml by example page. It’s not really ready for prime time but you can at least learn the basics with it and hell, even contribute if you want :)<p><a href="https://o1-labs.github.io/ocamlbyexample/" rel="nofollow">https://o1-labs.github.io/ocamlbyexample/</a>
This book was my introduction to OCaml, and I followed it concurrently with the Nand2Tetris course. Project 6 of Nand2Tetris [1] has you write an assembler for their hack computer, and OCaml seemed like a perfect fit. Chapter 10 of this book introduces you to parsing and lexing, and it was really fun following along while writing the hack assembler.<p>Here's an implementation for those interested: <a href="https://github.com/senhorsolar/hack-assembler" rel="nofollow">https://github.com/senhorsolar/hack-assembler</a><p>[1] <a href="https://www.nand2tetris.org/project06" rel="nofollow">https://www.nand2tetris.org/project06</a>
(Inspired by this post,) I gave the official ocaml tutorial a whirl. I quite enjoyed the syntax, and the easy install (of opam).<p>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.<p>[0] <a href="https://news.ycombinator.com/item?id=7418543" rel="nofollow">https://news.ycombinator.com/item?id=7418543</a>
If you want to learn OCaml, you should probably check
<a href="https://dev.realworldocaml.org/" rel="nofollow">https://dev.realworldocaml.org/</a> (free to read online)<p>It is co authored by Yaron Minsky, I think Yaron plays a big role in making OCaml relevant<p>I think OCaml would have been a far less popular language, had Yaron chosen another language for jane street
As a veteran of this class, I do believe it helped make me a better programmer. There's a noticeable divide in terms of programming confidence/flexibility/efficiency among the Cornell CS students who do well in this class and enjoy it, and those who fear it or runaway from it. That said, a lot of the benefit came from this course gathering the brightest CS students as TAs. Without having access to those TAs and the challenges they posed in section or office hours, I'm not sure it has nearly as much value.
The intro page says this course is not about OCaml, but then the remaining pages go into detail about the various features of OCaml. The problem with this approach is that when you read about a feature, you don't know if it is a OCaml-specific thing or whether it is a general functional programming concept.<p>I would like to see a course or textbook that explains functional programming in the abstract. Instead of going into the details of any one functional language, gives examples of how various functional languages implement the various core ideas of functional programming.<p>So, explain functional programming concepts such as pure functions, referential transparency, functors, monoids, monads, effects, lazy evaluation and so on, not in the context of any specific language, but giving examples from multiple functional languages.<p>In other words, focus on functional programming in general, instead of one specific implementation of it. I have been looking for such a textbook or course, but it doesn't exist.
> This course is about making you a better programmer.<p>It is a very bold statement. There is nothing in course about how to fight complexity. Knowledge how to traverse an ADT tree helps a little unfortunately. But it is a great classic CS course though.
Duplicate of <a href="https://news.ycombinator.com/item?id=27966135" rel="nofollow">https://news.ycombinator.com/item?id=27966135</a>
Apparently CS 3110 (Spring 2021) was only offered to students enrolled at Cornell. If true, why is this website of interest to HN readers? Just asking.
So from what I understand from this the objective is to teach a “vastly different perspective” and thereby improve one's programming productivity by idealistically a factor four, by being forced into a new way of thinking?<p>They could have certainly done something more radical than <i>OCaml</i> then such as, say, <i>Idris2</i> which is truly a challenge for those not used to it.