News for hackers. Stuff that matters.
Re:Two Years of OCaml by IshKebab on Tuesday May 02, 2023 @04:29AM (#35784787)
I agree with almost all of this. And I'd add that using OCaml on Windows is so painful as to be effectively not possible.

Where I slightly disagree:

1. I think expression based is fine. He's definitely right that OCaml does expressions wrong (it's very unclear where expressions end - I often end up adding and removing semicolons until the compiler stops complaining)... but I never have that problem in Rust.

2. Haskell's separation of the types of functions from the arguments is definitely not better. I don't want to have to manually count through two lists to match them up. And he correctly points out that currying is bad (overall) but at least OCaml sensibly separates arguments and return values, unlike Haskell which just checks them all in a -> separated list.

But overall this is a great list. I'm sure OCaml and Haskell programmers will feel like the author doesn't "get it" but I think if they search their feelings they'll know it to be true.

Re:Two Years of OCaml by yawaramin on Tuesday May 02, 2023 @07:49AM (#35786113)
It's also worth noting that the author says that even with these 'deficiencies', OCaml is still far above everything else :-)
Re:Two Years of OCaml by IshKebab on Tuesday May 02, 2023 @01:10PM (#35790838)
They didn't actually go that far, but yes it's still better than many languages.

I would say Rust solves almost all of the issues identified in this post. It obviously introduces the extra complexity of no GC & borrow checking, but if you're ok with that I don't see why you would pick OCaml over Rust.

Re:Two Years of OCaml by deredede on Tuesday May 02, 2023 @05:23PM (#35794415)
The menhir parser generator is extremely good and doesn't quite have an equivalent in the Rust world.

But other than that, in no particular order:

- While it has its downsides, OCaml's module system (and functors especially) is extremely powerful and allows for all sorts of higher-kinded abstractions that are currently out of reach of Rust's type system, especially when combined with first-class modules

- No monorphisation means more reasonable compile times

- Some of the advanced type system features (GADTs, extensible types, polymorphic variants) are really quite nice

(but really, menhir is great, and I miss it whenever I need to parse things in another language)

Re:Two Years of OCaml by yawaramin on Wednesday May 03, 2023 @01:58AM (#35798545)
> They didn't actually go that far

Yes, they did. This is literally from the third paragraph of the article:

> It’s actually a weirdly optimistic thing: that a language with so many glaring deficiencies stands far above everything else.

Re:Two Years of OCaml by delta_p_delta_x on Tuesday May 02, 2023 @07:54AM (#35786151)
> using OCaml on Windows is so painful as to be effectively not possible

Have you considered F# instead? Native support in the dotnet CLI, VS Code, Visual Studio, and Rider. Not to mention the huge .NET standard library...

Re:Two Years of OCaml by IshKebab on Tuesday May 02, 2023 @01:06PM (#35790785)
Yeah it's on my to-try list! Especially because it has native support for single file scripts with dependencies.

How many of the issues in this post does it solve? Or is it basically the same?

Re:Two Years of OCaml by dllthomas on Tuesday May 02, 2023 @05:13PM (#35794288)
> currying is bad (overall)

Super easy currying is great! Automatic currying is bad (overall).