logoalt Hacker News

throwaw12yesterday at 7:14 PM20 repliesview on HN

> Learn Programming with OCaml

Lately, I keep asking myself, do I need to learn this new thing, should I force myself to learn this thing, LLMs know it anyways and so on.

So (asking genuinely), should we learn these things?


Replies

xiaoyu2006yesterday at 7:25 PM

You can also learn for your own amusement, and solely for the fun of comprehension; a lot of mathematician were driven by this. It's a shame current social value places so much utilitariaism on learning.

show 4 replies
dadoumyesterday at 7:26 PM

My experience with OCaml has transformed how I think about programming and complex system design. This may also be true if you learn any other functional programming language, but OCaml is easy and flexible which makes it good imo as a door towards the more formal part of comp sci. Even for steering an LLM I think this might help.

show 1 reply
monsieurbananayesterday at 7:34 PM

You could have asked this question 10 years ago, long before llms. It's not like you'd realistically would get an ocaml job back then when there's so few of them, so why bother?

The answer is still the same as well, people learn ocaml either because they enjoy it, or because learning a functional language makes them a better programmer overall and teaches your brain to approach a problem in a different way.

henryrobbins00yesterday at 8:15 PM

Michael Clarkson teaches OCaml at Cornell. I highly recommend his free course materials [1]. He’s an excellent educator. Learning functional programming paradigms had a major influence on how I design programs. Clarkson also taught snippets from the Pragmatic Programmer, which was equally influential (as it has been for many many others) [2].

[1] https://www.cs.cornell.edu/courses/cs3110/2025sp/

[2] https://pragprog.com/titles/tpp20/the-pragmatic-programmer-2...

nine_kyesterday at 7:50 PM

Outsourcing all the thinking to machines may have consequences you might not like.

An oblique explanation: https://croissanthology.com/earring

adalaceloveyesterday at 7:17 PM

Should you learn history if it is already written in a book? Should you live if others are already living?

show 1 reply
yawaraminyesterday at 9:39 PM

Posting 'why should we learn' a programming language on Hacker News is top-quality ragebait :-D

ahokayesterday at 7:29 PM

Why learn an instrument when you can just press play?

show 2 replies
sgtyesterday at 7:35 PM

Seeing that you already know programming, I'd say it'd be less risky for you. But the only reason you're able to pilot an LLM to do programming for you, is because you understand programming and architecture.

But what about the future generations skipping the step of learning the OCaml's, the C's, the Python's...? It's quite concerning.

Oh by the way, yes. Learn OCaml!

sroerickyesterday at 10:55 PM

LLMs are better at OCaml than any other language, and being able to read and think in OCaml is very helpful to understanding LLM generated OCaml code.

Also, it may very well be the decade of formal verification - if so, OCaml is a good place to be.

zemyesterday at 9:45 PM

you are eventually going to have a very bad time if you do not have a solid mental model of the code the LLM is writing, and indeed if you cannot steer the LLM so that its code conforms to your mental models. learning ocaml is a great way to add some valuable tools to your toolkit when it comes to thinking about code and how it fits together.

yodsanklaiyesterday at 9:15 PM

LLM + static types is a winning combo. And if you want to be serious with what you do with your LLM, you need to understand the output to some extent.

That being said, you may as well use Rust. The extra complexity of manual memory management and Rust idiosyncracies are easily dealt with by the LLM.

bigstrat2003today at 12:09 AM

Yes. LLMs do not know anything, and they will make mistakes as a result. You have to be able to check their work if you wish to do a good job.

show 1 reply
andsoitisyesterday at 8:19 PM

I would sharpen my software engineering skills rather than coding / programming skills.

debo_yesterday at 11:08 PM

I think it's helpful to have a deep understanding of one c-type language, one lisp, and one ML-type language. There are so many things influenced by these three language families that being comfortable with them makes it so much easier to understand a wide variety of languages and libraries.

RobRiverayesterday at 8:36 PM

LLMs know it anyways?

Hhhmmmmm

doc_ickyesterday at 7:55 PM

I mean if you want to let llms do everything for you go ahead. Wall-e implications aside, it seems like a great self centric life.

shevy-javayesterday at 11:03 PM

I would not make that dependent on LLMs. If OCaml covers a use case you have, why not.

Personally I try to stick within my own niche though - ruby, java and also python (ruby is unfortunately losing grounds really hard now, the writing was on the well in the last some years though, and people such as DHH are now indeed a liability rather than an asset to be had, but that's a side topic).

I think what LLMs will force in the long run is to make programming languages used by real humans in a traditional way, more effective. That is, writing code by humans will have to become a lot more efficient, both time-wise and speed-wise. And for that there is always a use case IMO since LLMs are, despite the promo, incredibly stupid.

sublinearyesterday at 7:29 PM

What the hell else do you have to do?!

fuldekayesterday at 9:17 PM

[dead]