Re: [BLACKBOX] Go

From: [at]} <Josef>
Date: Tue, 17 Nov 2009 09:57:57 +0100

----boundary-LibPST-iamunique-283996397_-_-
Content-type: text/plain

I have to add this correction to my posting on go:

go does have a form of inheritance on the level of
struct by means of so-called 'anonymous fields'.
They allow for a mixin OO style, which means that
a struct T can be mixed into another struct S where
S inherits all fields and type bound procedures of T
(similar to a macro expansion).
There can be multiple mixins in a struct but there is no
compatibility between S and T unless you use an interface.

- JT


----- Original Message -----
From: "Josef Templ" <Josef.Templ{([at]})nowhere.xy
To: <BLACKBOX{([at]})nowhere.xy
Sent: Friday, November 13, 2009 9:53 AM
Subject: Re: [BLACKBOX] Go


> Hi Everybody!
>
> I have just scanned the Go language spec and it looks a lot
> like a mix from Oberon/CP and C with some interesting syntactical
> ideas borrowed from functional languages, I guess,
> but nothing really new.
>
> Regarding OO features it seems weak to me.
> It has type bound procedures but no inheritance.
> It doesn't even have type extension for records as the
> original Oberon introduced.
> (Please correct me if I missed something in the spec.)
>
> All it has is an interface type with structural equivalence rules.
> An interface is a purely abstract type that only specifies a set of
> method signatures. It is compatible with any type that has
> the appropriate set of type bound procedures, which is checked
> by the compiler.
>
> I guess it would be very hard to program something like the Oberon
> system with its many extensible message records in Go. The message
> records would have to be expressed by interfaces with setter and getter
> functions for accessing the record fields. And there is no subclassing for
> creating extended message types.
> It would also be very hard to program in a Java/C++-OO-style with
> tons of methods inherited by subclasses. These would have to
> be replicated by the programmer.
> May be they envision a new OO-programminig style that
> I am not aware of.
>
> This is at least my understanding from the language spec.
>
> A questionable point, in my oppinion, is the way exports are marked.
> Go uses the convention that a name starting with a capital letter is public.
> So when you decide to export a previously private name later on,
> you have to change that name.
> For me, the funniest part of the language spec is the name for threads in Go.
> They are called 'goroutines'.
>
> - JT
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibP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