keean/zenscript

Objects or No Objects

Closed this issue · 8 comments

keean commented

Discussion about records vs objects

Please define the terms 'record' and 'object' and why they are not the same?

Our misunderstandings arise when we have different perspectives on meanings and default semantics.

Link to potentially relevant discussion?

keean commented

If you read the OOHaskell paper you will find that an object is the fixed point of a record. However I in general prefer to separate data and functions.

A record is like a namespace, and a value of a record type is a particular implementation or value. In basic terms a record is like a C struct.

@keean wrote:

If you read the OOHaskell paper you will find that an object is the fixed point of a record.

Are you referring to page 15, where setting the tail to the Unit type?

Again this seems to be a conclusion that is specific to Haskell's type system and how you are representing inheritance? And what does inheritance have to do with objects?

keean commented

I think we are agreed to have simple objects. No inheritance just interfaces/type classes. Closing as decided.

You mean no virtual inheritance and no subclassing. But what about typeclass objects? And what about unions being subtypes? I don't think we can nail down those yet?

keean commented

I think the conclusion here is we are having objects, which will be at least simple objects. The other things are the subject of other threads, but to cover my thoughts, I don't think we need typeclass objects because we have union types. By no inheritance I mean you cannot extend object A. You can extend a typeclass but that is something different. We have interface inheritance, but not implementation inheritance.

@shelby wrote:

I don't think we need typeclass objects because we have union types.

Disagree.