News for hackers. Stuff that matters.
Re:C++ the Good Parts (2014) by pjmlp on Thursday October 01, 2020 @06:00AM (#24649216)
Traits are OOP, check out on Objective-C and CLOS/Flavors protocols, Smalltalk categories, alongside a couple of SIGPLAN papers on component programming.
Re:C++ the Good Parts (2014) by vbarrielle on Thursday October 01, 2020 @07:47AM (#24649819)
Haskell typeclasses are quite close to Rust traits, does Haskell count as OOP then?
Re:C++ the Good Parts (2014) by pjmlp on Thursday October 01, 2020 @07:55AM (#24649872)
Yes, Haskell has all the necessary features to implement some forms of OOP.

There are plenty of OOP flavours, just like there are plenty of FP flavours.

If one considers 100% Haskell's features as must have for a language to be considered FP, then OCaml and Standard ML are going to have a hard time to be considered FP.

Re:C++ the Good Parts (2014) by int_19h on Thursday October 01, 2020 @06:24PM (#24656808)
IIRC, Haskell doesn't have the notion of object identity. It wouldn't make sense in an immutable language, anyway, because identity only matters if object state can change - otherwise any two objects with identical state are substitutable. But anyway, I would argue that this is the crucial difference that sets apart "objects" and "values with syntactic sugar for function calls".