Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

OT: how come there are so many OCaml posts recently? Genuinely curious!


Some 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.


I 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.


I 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.


Thankfully 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/


The "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.


Go 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.


Anecdotally, 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.


I 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.


Ditto, 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).


Having 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.


Yeah 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.


OCAML on Windows was such a pain several years back. It's good to hear that they've improved on it.


OCaml 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.


Before OCaml multi core it was a non starter for many applications. Now, OCaml can be used for almost anything!


I really rooting for the Riot framework. It's based on the actor model and makes using multi core in OCaml a breeze.


Well its feature list seems positively delightful: 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...) reducing the benefits of exhaustiveness checking, but it still seems rather interesting!


I 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/. So it's not really a surprise to me that it gets some waves of posts every now and then.


It feels like we're (IT, hackers, et. al.) finally growing up.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: