6 ms·
Is OCaml an especially comfortable environment to work in? One of my favorite programs, an ncurses-based RPN calculator called Orpie, is written in OCaml, but
by dlcarrier 1y ago
Is OCaml an especially comfortable environment to work in?
One of my favorite programs, an ncurses-based RPN calculator called Orpie, is written in OCaml, but I've never messed around with it.
- Crespyl 1y agoHey, I've also used and loved Orpie! I'm not extremely familiar with any of the ML family, but Eric Lippert had a blog series I followed for a while in which he was writing a Z-Machine in OCaml: https://ericlippert.com/2016/02/01/west-of-house/ https://ericlippert.com/2016/02/01/west-of-house/ I followed along but in Rust for a while, though I think he paused the project at some point and I lost steam. I learned more about Rust (which, IIRC was first implemented in OCaml) than I did about OCaml, but it's always seemed like a nice language.
- yawaramin 1y agoLippert started doing that blog series as part of his learning journey when he got hired at Facebook to write OCaml. Just a fun historical fact.
- Yoric 1y agoWell, many of the benefits of Rust, but in a simpler and garbage-collected language. Possibly the best language (alongside Haskell) if you need pattern-matching. Not quite as good if you need lots of libraries or interaction with other languages.
- nextos 1y agoIt does have a lively ecosystem in some niches. Formal verification is one of them. For example, https://opam.ocaml.org/packages/why3 https://opam.ocaml.org/packages/why3 is a little marvel of engineering.
- yawaramin 1y agoDoes Haskell have or-patterns yet? Last I checked OCaml still has the lead in pattern matching power :-)
- antonvs 1y agohttps://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/or_patterns.html https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/or_p...
- yawaramin 1y agoI'm confused about something. According to https://www.haskell.org/ghc/ https://www.haskell.org/ghc/ version 9.10.3 was released on 2025-09-10. How is there a version 9.12.1 listed for the or-patterns feature? Are these versions for different things?
- tome 1y agoThey're versions of the same thing, and 9.12.1 was chronologically before 9.10.3. It looks like you can find the entire chronology at https://www.haskell.org/ghc/blog.html https://www.haskell.org/ghc/blog.html
- yawaramin 1y agoOK, side note, whoever decides the GHC release numbers should be pulled aside and given a quick talk about how version numbers are supposed to work. Anyway, looks like or-patterns just landed as a GHC extension: foo (Bar; Baz) = 0 I still like OCaml's (built-in) syntax better: let foo (Bar | Baz) = 0 Which I feel stems from its elegant decision to use the pipe character as the 'alternative pattern prefix': let foo = function | Bar | Baz -> 0
- tome 1y ago> whoever decides the GHC release numbers should be pulled aside and given a quick talk about how version numbers are supposed to work How is that?
- poulpy123 1y ago> Is OCaml an especially comfortable environment to work in? It is one of these small languages that are not completely niche: it is taught and used, you'll be able to do plenty of things, but there is not the community and resources you find in the big ones or even the mid-sized ones
- vipvip 1y ago[dead]
- yawaramin 1y agoThe thing that I really like about it is that the compiler is very, very fast. Especially when you're in the edit-compile-rerun cycle and doing incremental compiles. This gives people a huge productivity boost and keeps them in flow state much more easily.
- cdaringe 1y agoCertain parts are unmatched joy. However, some things, as basic as printing arbitrary data types, are annoying, compared to other langs.