38 ms·
Yeah, I'm not sure I understand the author's complaint. OCaml has modules, associated types, anonymous modules, GADTs, polymorphic variants, and row polymorphi
by Verdex 3y ago
Yeah, I'm not sure I understand the author's complaint. OCaml has modules, associated types, anonymous modules, GADTs, polymorphic variants, and row polymorphism. All of which are kind of like interfaces.
As far as I can tell, the complaint is maybe that ocaml doesn't have something exactly like C#/Java interfaces (which I think is a fair assessment). So maybe the author is lamenting that they can't just rewrite their java code in every language?
Although, they also mention rust traits. Which at first blush look very similar to c#/java interfaces (at least closer than anything ocaml has). However, at least in my experience, rust traits don't quite fulfill the same niche as c#/java interfaces because rust cares a lot about when you can figure out the size of your objects. So every time I tried to use them like I would a C# interface, I wound up regretting the decision.
Ultimately, this article feels like a superficial "I don't like ocaml" blurb. There is a lot to be warry of with respect to ocaml. Although, the fact that ocaml still exists as a niche language with a lot of very significant maintenance and active development (effects + multithread recently landed), shows that the author did not pay sufficient attention.