3 ms·
I have been an Ocaml user for a decade at this point and using Ocaml in the tech stack for the business I'm building. In my opinion: - Dependency management i
by sausagefeet 4y ago
I have been an Ocaml user for a decade at this point and using Ocaml in the tech stack for the business I'm building. In my opinion:
- Dependency management is not great in opam. I find it especially frustrating that the tried to be really clever with a SAT solver and it rarely does what I want it to do. That being said, I rarely run into issues with old builds of something failing. I only have a few projects on opam and I will get PRs for fixing my project to support later builds. The bigger issue, IMO, is there is no great way to mirror all the deps your project needs locally so you don't have to worry about them disappearing.
- I have never run into the issue you've described here. In general, a package on opam just builds. I rarely have to modify an existing package, but when I do it has not been an issue.
- Error messages aren't great, but I have never really hit this Syntax Error problem you run into (maybe you are one of those people that uses ";;"?). Error messages have also improved a lot over the last few versions, even around polymorphic variants, which has been a much welcomed improvement.
- Documentation of third party libraries is unequally distributed. I find the language and std lib well documented, but for a library it depends. There is lots of room for improvement here. But on the flip side: I've run into plenty of libraries in Rust with bad documentation as well.
- I think this comment on modules is a big unfair. Modules were never designed to solve the problem of typeclasses or traits. As you mentioned, module implicits might allow modules to be used as a solution, though. But on the flip side, type classes and traits struggle to express what modules can express, and I dearly miss modules when I work in any other language.
I agree: Ocaml is a very nice language.
- tremon 4y agoAs someone who has dabbled in Ocaml but has more experience with Haskell typeclasses and Rust traits, is there a good primer on what Ocaml modules are and how they're supposed to be used? Just porting my previous assumptions on traits/typeclasses over to Ocaml hasn't led me to very satisfying results.
- sausagefeet 4y agoI'm not aware of any particular document, know. I have just read the language spec for modules. I know that sounds scary but, IMO, it's very approachable. And then, I think you just need to play with it to get a feel for me. But maybe someone else has a better introduction. But I think typeclasses and traits are about polymorphism, and that isn't what modules are about, they are about encapsulating code. https://v2.ocaml.org/releases/4.14/htmlman/modtypes.html https://v2.ocaml.org/releases/4.14/htmlman/modtypes.html https://v2.ocaml.org/releases/4.14/htmlman/modules.html https://v2.ocaml.org/releases/4.14/htmlman/modules.html https://v2.ocaml.org/releases/4.14/htmlman/firstclassmodules.html https://v2.ocaml.org/releases/4.14/htmlman/firstclassmodules...