Comment by throwaw12

16 hours ago

> 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?

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.

  • I like baking. There are machines that can bake bread at an industrial scale that I cannot compete with. There are home kneaders that do much of the work very well. I use one of those more often than not.

    I still think it worth my time kneading dough by hand. It teaches me the various properties of flour, how external factors like humidity or temperature impact the overall process, and I believe that it makes me a better baker, even when I use a machine, because I am better at controlling what the machine does. When I get a new brand of flour I will make sure to bake everything by hand first to "get a feel".

    Kneading by hand is also very relaxing to me. This is probably the main reason I bake in the first place.

    Programming, and other activities are not very different. We now have machines that can do it faster, at a fraction of the quality many people deem good enough. If you hate coding, that is probably all you need to use, and learning a new language might just be a frustrating experience not worth subjecting yourself to. But if you enjoy coding then it should make you better at it, even when you use the machines.

  • This. The question can be seen like “should I learn to solve sodoku, if a computer can do it better?”

  • As always, it is good to be aware that many people are too anxious about more existential issues to comfortably an consistently expend effort on intellectually-taxing tasks that aren't perceived as directly related to their survival. If it's an issue with social values, it's less of one related to learning as it is to perpetuating artificial scarcity.

    • >to comfortably an consistently expend effort on intellectually-taxing tasks that aren't perceived as directly related to their survival.

      the average person spends 6(!) hours a day on their smartphone, the average TikTok user spends 100 minutes on the app alone. This isn't about artificial scarcity, it's about the average person looking like the Wall-E people

      4 replies →

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.

  • My experience with lisp was exactly that: it completely changed how I think about programming, but much more, how I think about systems and engineering. (I learned it through SICP)

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.

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

Why learn an instrument when you can just press play?

  • Cultural inertia: until recently, you couldn't just press play and get even a wide selection of music: for most of history, if you wanted music, you had to make it or hire someone to do it for you.

    More recently, you had to go to the store and buy it, which meant you didn't have much variety.

    Today, learning an instrument is for social status, inheriting the shine of the past, where music was rare and costly. The reason to learn an instrument today is because the former situation was romanticized.

    It'll probably take a generation before people ease into guilt-free enjoying infinite, fully generated music.

    • These theories sound vaguely plausible.

      I would rate them as about 5% true and 95% false, as explanation of the past and prediction of the future.

      The satisfaction of learning to do something difficult isn't going away, and the social status associated with it won't either.

      1 reply →

    • > The reason to learn an instrument today is because the former situation was romanticized.

      Lol. The reason to learn an instrument is because it is directly pleasurable to play an instrument. You've got consumer/spectator brain.

      I mean, why post a comment when you could have just read a comment?

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

I wanted to learn a functional programming language with powerful type capabilities and I chose the Lean Language for that and not OCamel or Haskell. Reason being: Better type system (dependent types!), applicable in formal domains and can use it to learn math too.

For your bread and butter programming, there is already JS/Go anyways.

So don't see much point in learning OCamel.

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!

Keep using your brain or you will forget stuff. Doing puzzles is great, programming in new languages is also great.

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.

This mindset (i.e. LLMs are available so why do i need to learn anything?) is highly insidious and will destroy your brain/mind/future if you let it.

Humans are the ones who Understand, while LLMs only Know.

So inter-disciplinary/cross-disciplinary insights, new modes of thinking/reasoning, flashes of insight etc. are still in the purview of Humans only. AI/LLMs can help focus and short-circuit the study of various subjects but their understanding can only happen within a human "Mind". If you do not even have basic domain knowledge (i.e. unknown unknowns) how can you even prompt/query an LLM for answers?

A few illustrative examples; a) Newton came up with limits/calculus out of a need to measure continuous motion with varying speeds b) Kekule came up with the benzene ring from a dream where he saw a snake grab its own tail c) Descartes came up with the cartesian coordinates in an attempt to solve geometry via algebra etc. Each of these was a novel leap of insight bringing together various concepts to create entirely new knowledge domains.

So one should learn/study the core concepts/ideas in various domains and then push the tedious mechanical labour onto the machines. In this regard see also the concept of "Active Learning" - https://en.wikipedia.org/wiki/Active_learning

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.

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.

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.

  • This isn’t really true for many programming tasks anymore. And as the saying goes, “this is the worse they will ever be”.

    • > “this is the worse they will ever be”

      This is assuming that the current state of LLMs is sustainable, which it definitely isn’t.

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.

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.

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.