4 ms·
OT: how come there are so many OCaml posts recently? Genuinely curious!
by eska 2y ago
OT: how come there are so many OCaml posts recently? Genuinely curious!
- kinow 2y agoI don't know if there's any reason like a project, derived language, or some new feature. But there are always posts and comments about OCalm at https://old.reddit.com/r/functionalprogramming/ https://old.reddit.com/r/functionalprogramming/. So it's not really a surprise to me that it gets some waves of posts every now and then.
- pieix 2y agoOCaml is the one language I’ve used whose standard library is great to read. It’s a very developer-friendly language but in all of the ways that make it popular on HN and rarely used in the real world.
- mattarm 2y agoSome popular streamers have dabbled in OCaml this year, sometimes calling it "the Go of functional programming", which probably set off a small wave of people tinkering with the language. OCaml has also gotten gradually better in recent years in terms of tooling, documentation, standard library, etc.
- adambrod 2y agoI think they were saying that Gleam was Go of functional programming? OCaml may be like Go compared to Haskell but IMHO Gleam really embraces simplicity and pragmatism.
- myaccountonhn 2y agoI would say some other reasons OCaml is similar to Go is that the runtime is very simple, performance is on par and the compilation times are very fast. It also markets itself as a GC'd systems language similar to Go. I think a seasoned OCaml would be able to guess the generated assembler code. I suspect that Gleam is quite different in that regard.
- pjmlp 2y agoThankfully it has a modern type system, though. As for the GC systems language, there is even a book about it, https://ocaml.github.io/ocamlunix/ https://ocaml.github.io/ocamlunix/
- thesz 2y agoThe "Go of functional languages" title should go to Haskell. The Haskell's STM and channels implemented in it allow for most (or all) of the Go "select" statement, but in a library, not language.
- nequo 2y agoGo prioritizes simplicity and pragmatism which is much more like OCaml than Haskell. Haskell is more like a Rust of FP. But Rust is also much more pragmatic than Haskell.
- fire_lake 2y agoBefore OCaml multi core it was a non starter for many applications. Now, OCaml can be used for almost anything!
- adambrod 2y agoI really rooting for the Riot framework. It's based on the actor model and makes using multi core in OCaml a breeze.
- _flux 2y agoWell its feature list seems positively delightful: https://github.com/riot-ml/riot https://github.com/riot-ml/riot ! Basically, it seems, it's Erlang for OCaml. Hot reloading would be a cool feature, though, but I can see why it's not implemented, at least not yet.. I recall the OCaml native toplevel is able to load code in dynamically, so that could be the mechanism to do it. It seems to use open types for handling messages (per just looking at https://github.com/riot-ml/riot/tree/main/examples/3-message-passing https://github.com/riot-ml/riot/tree/main/examples/3-message...) reducing the benefits of exhaustiveness checking, but it still seems rather interesting!
- sporkl 2y agoAnecdotally, I feel like OCaml is growing in popularity, probably due to ecosystem improvements. Stuff like dune and other OCaml Platform tools becoming mature, multicore support, recently first-class Windows support, etc.
- ericjmorey 2y agoOCAML on Windows was such a pain several years back. It's good to hear that they've improved on it.
- myaccountonhn 2y agoI also suspect that people are more open to a language like OCaml. With Rust and javascript being so popular, a lot of constructs in OCaml will not seem so foreign. OCaml is in many ways a sane Typescript or a functional version of Go.
- adambrod 2y agoDitto, it feels like more people are coming around to the ML style type systems. I'm hoping Gleam will fill the void with a scalable BEAM backend and compiling to JS with Lustre on the frontend (or even just serverside with htmx).
- pjmlp 2y agoHaving known OCaml since Caml Light days, Go's type system has nothing to do with OCaml, it is exactly the kind of languages the Go community rants about.
- myaccountonhn 2y agoYeah I don't think the Go community would like OCaml very much. But I do think there are some similarities, in that they both have great compile times, as a functional language OCaml is quite simple, they are both GC'd systems languages and both have predictable runtimes. So if you appreciate a lot of ideas in Go, but find them too conservative and the error handling too tedious, OCaml might be a good choice.
- carapace 2y agoIt feels like we're (IT, hackers, et. al.) finally growing up.