Skip to content

Comment on Pain Points of OCamlparent

Comments

They would have to actually read the documentation to understand and that's simply too hard nowadays so you end up which this kind of articles about "pain points" which are basically "I don't know what I'm doing and making a lot of mistakes, let me blame my tool".

Way to deflect any possible criticism x) I've used Ocaml for many years, and the syntax is undeniably a drag. There are inconsistencies, poor choices, none of which are a dealbreaker on their own but which together impose an ever-present friction. Death by a thousand cuts if you will. One of them explicitly mentioned in the article: the match statement.

For printing, they quote "#[derive(Debug)]" in Rust but apparently they never reached ppx_deriving in Ocaml. It's a shame because it does exactly the same thing.

How do you print a list in OCaml? There's your answer as to why it's not the same thing.

Way to deflect any possible criticism

There is no blame to defect. What’s supposed to be so weird about Ocaml syntax?

How do you print a list in OCaml? There's your answer as to why it's not the same thing.

Don’t get your point.

You can ppx_derive on a list type. There is a feature specifically designed for this common use case. That gives you a pretty printer for a list. Alternatively you can tier the type pretty printer.

Is there supposed to be something special with lists?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.