Hacker News new | past | comments | ask | show | jobs | submit login

I just have the feeling that the author is trying to explain OOP with the vocabulary of 1974.

What did you find interesting in this paper?




Some of those ideas are also in OOP. But I think that might just be seeing what you are used to. The paper's ideas fit eg OCaml's ideas of modules and abstract types just as well.


A key difference from OCaml's modules (besides the lack of type parameterization) is Liskov's data types have associated data. So it's more like Rust's structs. Also, like in Rust, there is no support for multiple implementations of a single signature.


Thanks!

Though couldn't you associate data with your OCaml modules, too?


It's been a while since I played with OCaml, but I'm pretty sure that modules are stateless. A quick googling shows that you can use global state, but it's not the same as one instance of state per one instance of struct as in Rust.


I should have been less tentative: you can add values to modules, and you can add mutable values to modules. And that state is not global at all. (Though you might be able to ask for global state.)

They are often used without mutable state, but the language doesn't make them so.

See eg https://realworldocaml.org/v1/en/html/first-class-modules.ht...


Then you were right, I should've checked before answering.


No worries. Thanks!




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

Search: