Live data from Hacker News

Why I love OCaml (2023)

mccd.space

81–90 of 313 posts

Re: Why I love OCaml (2023)

#81
post #13

OCaml’s REPL is lovely, but I found myself having some friction with initial startup. The build/package system was pretty convoluted, and I ended up choosing JS’s Core stdlib for my needs (a simple compiler). With the new multicore release it’d be cool to see OCaml in some more practical projects!

As an OCaml-curious, is this the community recommendation, to choose the Jane Street stdlib if you’re just getting started?

Re: Why I love OCaml (2023)

#82
post #51

Elixir is the closest thing to OCaml that has a chance at semi-mainstream usage IMO. It has basically all of the stuff about functional programming that makes it easier to reason about your code & get work done - immutability, pattern matching, actors, etc. But without monads or a complicated type system that would give it a higher barrier to entry. And of course it's built on top of the Erlang BEAM runtime, which ha…

immutability? Interactive Elixir (1.19.0) - press Ctrl+C to exit (type h() ENTER for help) iex(1)> x = 1 1 iex(2)> x = 2 2 iex(3)> What's immutable about elixir? It's one of the things which I MISS from Erlang -- immutability.

This is like saying Haskell doesn't have immutability because it has the state monad, or that rust doesn't because you can shadow with let.

Data is immutable and thats much more important than whether local variables can be modified imo.

Re: Why I love OCaml (2023)

#83

Earlier quoted context omitted.

Perhaps OCaml is the Velvet Underground of languages. Only a few thousand people learned OCaml but every one made a programming language[1] [1]: https://quoteinvestigator.com/2016/03/01/velvet/

That would be Elm :)

I've been saying for ages! Gleam, Roc, Derw, Gren, Cara, Zokka, and the error messages in Rust.

https://news.ycombinator.com/item?id=45646520#45752905

Re: Why I love OCaml (2023)

#84
post #7

To this day, whenever I see Machine Learning abbreviated, my heart skips a beat, then I become crestfallen as I realize I'm not about to read something about Meta Language.

I'd rather have that issue than seeing "AI" plastered all over the place. I'm of the opinion AI should be reserved for artificial general intelligence. These things aren't intelligent yet. They're just em-bloat-ified traditional machine learning techniques. Not that they're useless. I just hate the terminology. If people start using the term AI, we better be living in I, Robot. Not whatever the hell this is. Tangenti…

We lost this fight at least by 1994 when Sun acquired “Thinking Machines,” which to its credit was bankrupting itself by making highly parallel supercomputers, at least. Now of course there is a new AI company of the same name. If the wrestling world echoes the computing world, one can only wonder what in 5-10 years will be the equivalent of Undertaker throwing Mankind off of Hell In A Cell to plummet 16 feet down through an announcer’s table...

Re: Why I love OCaml (2023)

#85

There's some other stuff, but I personally believe if the tooling was closer to Rust/Go than C, it would be a lot, lot more popular. Nobody wants to effectively learn a lisp to configure a build system.

Dune is quite good these days. The lisp part is really just sexps (not a full languge). But i kind of get your point.

Re: Why I love OCaml (2023)

#86

For something a bit more modern but still related to OCaml, one can try F#.

F# is a practical choice but the language features are quite far behind OCaml now. {Ecosystem, Functors} - choose 1

F# also has a real slow compiler. Last time hello world took a few secs on brand new mac.

Re: Why I love OCaml (2023)

#88
post #4

Earlier quoted context omitted.

Almost there, but in the meantime supporting a casual squillion dollars of trades at JS

Unless you're building another JS, it'd be nice if there were other companies so heavily invested in it. There's a lot out there beyond compiler prototypes and high speed financial trades, but there's not enough talk of people using ocaml for those things.

Ocaml was (historically, at least) used by Facebook for basically all of their linter/compiler/type checker work. The hack checker was in Ocaml, as was the JS thing (flow, maybe?).

So that does seem to be a good use-case for the language.

Re: Why I love OCaml (2023)

#89
post #51

Elixir is the closest thing to OCaml that has a chance at semi-mainstream usage IMO. It has basically all of the stuff about functional programming that makes it easier to reason about your code & get work done - immutability, pattern matching, actors, etc. But without monads or a complicated type system that would give it a higher barrier to entry. And of course it's built on top of the Erlang BEAM runtime, which ha…

immutability? Interactive Elixir (1.19.0) - press Ctrl+C to exit (type h() ENTER for help) iex(1)> x = 1 1 iex(2)> x = 2 2 iex(3)> What's immutable about elixir? It's one of the things which I MISS from Erlang -- immutability.

Shadowing is not mutability. The former isn't affected by control flow nor does it affect closures.

Re: Why I love OCaml (2023)

#90

>why isn’t OCaml more popular? OCaml did become popular, but via Rust, which took the best parts of OCaml and made the language more imperative feeling. That's what OCaml was missing!

Ocaml can be as imperative as you need it to be. Or as functional.

It has no dogmatic inclination towards functional. It has a very pragmatic approach to mutation.

Post reply on HN