"OCaml -- first impressions"

user-feedback

#122

I do use ;; quite often, mostly to limit the search scope for syntax errors and of course the REPL.


#123

Going to state the obvious here: that is a serious and avoidable usability flaw.


#124

you mean ;;? in my opinion, it’s actually useful in the toplevel: easy editing of multiline input. as long as ;; is not typed, you can just continue editing. within a module i would agree that it’s not so useful but i find it not serious.

my personal serious usability flaw is the amount of work needed to get pretty-printing of user defined types…


#125

[@@deriving show] is pretty easy to add to your type declarations, IMHO…


#126

i guess you’re right. but when i started i wanted to keep out anything that adds complexity, including syntax extensions or preprocessors. i think it’s odd that one has to use something that generates invisible code in order to get printing. maybe that’s a price to pay for abstraction and strong types?


#127

Given some sort of ad hoc polymorphism (typeclasses, modular implicits, etc.) one can handle printing a bit nicer, and someday, OCaml will have such a thing. However, as thing stand in OCaml, using the deriving ppx is the easy choice.


#128

Even then, though, I don’t know/think that we’ll get printers for things like variant and record types for significantly less cost than we have now. So there will continue to be a place for deriving-like functionality.

:100:


#129

Indeed. The question perhaps is, should we bundle certain ppxs with dune by default?


#130

The deriving extensions are included by default in the compiler in Haskell and Rust and are advertised as the recommended way to implement pretty-printing and similar trivial functionality.

We should do a better job at guaranteeing a smooth usage of ppx_deriving on the tooling level and promoting them in official docs.