Live data from Hacker News

OCaml Programming: Correct and Efficient and Beautiful

cs3110.github.io

1–10 of 251 posts

Re: OCaml Programming: Correct and Efficient and Beautiful

#2
I learned some Haskell years ago but it didn't stick with me. Lately, I want to get back into functional programming to see whether I'm missing out on something. This book looks nice, and so does OCaml. Any suggestions on books, courses, or resources on this subject?

Also, just to get proper motivation, why should I learn functional programming as a capable Software Engineer?

Re: OCaml Programming: Correct and Efficient and Beautiful

#4
post #2

I learned some Haskell years ago but it didn't stick with me. Lately, I want to get back into functional programming to see whether I'm missing out on something. This book looks nice, and so does OCaml. Any suggestions on books, courses, or resources on this subject? Also, just to get proper motivation, why should I learn functional programming as a capable Software Engineer?

You can strengthen the skill of thinking about your programs in terms of higher level abstractions, which allows you to have an overview and reason about larger systems.

Re: OCaml Programming: Correct and Efficient and Beautiful

#5
I spent a lot of time on Standard ML in university.

OCaml was always portrayed as the engineer's alternative for real applications.

I spent some time brushing up on OCaml a few years ago using Exercism.io.

While OCaml is a personal "top tier" language, I'd always prefer Haskell, Rust or Scala.

Type classes / traits just seem to beat a higher-order module system for me.

Re: OCaml Programming: Correct and Efficient and Beautiful

#7
post #2

I learned some Haskell years ago but it didn't stick with me. Lately, I want to get back into functional programming to see whether I'm missing out on something. This book looks nice, and so does OCaml. Any suggestions on books, courses, or resources on this subject? Also, just to get proper motivation, why should I learn functional programming as a capable Software Engineer?

Dan Grossman's Programming Languages is a great 3 language online course. It gives you the opportunity to compare standard ML, ruby and racket.

Before that course I was already grouping languages by inheritances from C or Lisp families, but really started to recognize and appreciate ML more.

Re: OCaml Programming: Correct and Efficient and Beautiful

#8
post #2

I learned some Haskell years ago but it didn't stick with me. Lately, I want to get back into functional programming to see whether I'm missing out on something. This book looks nice, and so does OCaml. Any suggestions on books, courses, or resources on this subject? Also, just to get proper motivation, why should I learn functional programming as a capable Software Engineer?

Berkeley's Programming Languages and Compilers references this book and you get to apply OCaml to something non-trivial.

https://inst.eecs.berkeley.edu/~cs164/fa21/

Re: OCaml Programming: Correct and Efficient and Beautiful

#9
post #2

I learned some Haskell years ago but it didn't stick with me. Lately, I want to get back into functional programming to see whether I'm missing out on something. This book looks nice, and so does OCaml. Any suggestions on books, courses, or resources on this subject? Also, just to get proper motivation, why should I learn functional programming as a capable Software Engineer?

You should learn multiple paradigms to broaden your horizon, so you are able to approach a problem from multiple angles and decide on the best design approach.

I don't write in a functional language in my day job, but I'm much more aware of global state and side-effects in my code than before. We mainly write in Python and C#, but I encourage my team members to dabble in SQL (for dataset manipulation) and Haskell (for functional purity). If anything, it makes them understand LINQ better.

Re: OCaml Programming: Correct and Efficient and Beautiful

#10
post #2

I learned some Haskell years ago but it didn't stick with me. Lately, I want to get back into functional programming to see whether I'm missing out on something. This book looks nice, and so does OCaml. Any suggestions on books, courses, or resources on this subject? Also, just to get proper motivation, why should I learn functional programming as a capable Software Engineer?

For Ocaml in particular, one thing that is pretty cool about it is the module system. Although we unfortunately can't use this module system in other languages, it taught me some interesting lessons about abatract data types.
Post reply on HN