Live data from Hacker News

OCaml Programming: Correct and Efficient and Beautiful

cs3110.github.io

11–20 of 251 posts

Re: OCaml Programming: Correct and Efficient and Beautiful

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

Another thing I recommend everyone to learn at least once is sum types aka algebraic data types. And how they are the dual to class based dispatch (what some call the "expression problem"). Sum types aren't exclusively found in functional languages, but they are certainly prominent in them.

Re: OCaml Programming: Correct and Efficient and Beautiful

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

IMHO the main reason to learn functional programming is to learn to untangle state and behaviour.

Re: OCaml Programming: Correct and Efficient and Beautiful

#14
post #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.

I also find it hard to spot why OCaml is the natural "step up" for creating real world applications instead of Haskell, Rust, Clojure or even Kotlin, C++, Python and Go.

Re: OCaml Programming: Correct and Efficient and Beautiful

#16
post #14
post #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.

I also find it hard to spot why OCaml is the natural "step up" for creating real world applications instead of Haskell, Rust, Clojure or even Kotlin, C++, Python and Go.

let's see:

    - OCaml vs Haskell: eager vs lazy  (=> memory consumption is more predictable)
    - OCaml vs Rust: OCaml has a GC (=> comfort) OCaml has tco (could not resist this ;) )
    - OCaml vs Clojure: vastly superior typing system. (=> less bugs)
    - OCaml vs Kotlin: no JVM needed.
    - OCaml vs C++: more safety. once it compiles it will not segv.
    - OCaml vs Go: vastly superior typing system. (=> less bugs)
    - OCaml vs Python: vastly superior type system, way better performance.
The biggest risk of doing OCaml (or Haskell or Rust) for extended periods of time is that you will be unable to hide your feeling of superiority towards (fe) a python developer.

Re: OCaml Programming: Correct and Efficient and Beautiful

#18
post #14

Earlier quoted context omitted.

I also find it hard to spot why OCaml is the natural "step up" for creating real world applications instead of Haskell, Rust, Clojure or even Kotlin, C++, Python and Go.

let's see: - OCaml vs Haskell: eager vs lazy (=> memory consumption is more predictable) - OCaml vs Rust: OCaml has a GC (=> comfort) OCaml has tco (could not resist this ;) ) - OCaml vs Clojure: vastly superior typing system. (=> less bugs) - OCaml vs Kotlin: no JVM needed. - OCaml vs C++: more safety. once it compiles it will not segv. - OCaml vs Go: vastly superior typing system. (=> less bugs) - OCaml vs Python:…

What about Swift?

Re: OCaml Programming: Correct and Efficient and Beautiful

#19
post #14

Earlier quoted context omitted.

I also find it hard to spot why OCaml is the natural "step up" for creating real world applications instead of Haskell, Rust, Clojure or even Kotlin, C++, Python and Go.

let's see: - OCaml vs Haskell: eager vs lazy (=> memory consumption is more predictable) - OCaml vs Rust: OCaml has a GC (=> comfort) OCaml has tco (could not resist this ;) ) - OCaml vs Clojure: vastly superior typing system. (=> less bugs) - OCaml vs Kotlin: no JVM needed. - OCaml vs C++: more safety. once it compiles it will not segv. - OCaml vs Go: vastly superior typing system. (=> less bugs) - OCaml vs Python:…

No post body was provided.
Post reply on HN