Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, the O in OCaml extends the type system with structurally typed objects and a classic OOP class system.

They're conceptually nice, specially the in-place object syntax, but the class syntax feels tacked on and the overall implementation is very naive compared to a proper OOP runtime like CLR/JVM/JS.

I suggest reaching for them only when first-class modules aren't enough (i.e. you need open recursion). Even then you could sometimes get away with polymorphic variant constraints, but that's admittedly harder to read and understand.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: