▲ | pmahoney 4 days ago | |||||||||||||
I tried to like OCaml for a few years. The things that hold me back the most are niggling things that are largely solved in more "modern" langs, the biggest being the inability to "print" arbitrary objects. There are ppx things that can automatically derive "to string" functions, but it's a bit of effort to set up, it's not as nice to use as what's available in Rust, and it can't handle things like Set and Map types without extra work, e.g. [1] (from 2021 so situation may have changed). Compare to golang, where you can just use "%v" and related format strings to print nearly anything with zero effort. [1] https://discuss.ocaml.org/t/ppx-deriving-implementation-for-... | ||||||||||||||
▲ | throwaway127482 4 days ago | parent [-] | |||||||||||||
Go's %v leaves a lot to be desired, even when using %+#v to print even more info. I wish there was a format string to deeply traverse into pointers. Currently I have to import go-spew for that, which is a huge annoyance. Python does it best from what I've seen so far, with its __repr__ method. | ||||||||||||||
|