On 11/10/2009 09:02 PM, dsimcha wrote:
== Quote from Phil Deets (pjdee...@gmail.com)'s article
On Tue, 10 Nov 2009 21:21:27 -0500, Knud Soerensen
<4tuu4k...@sneakemail.com>  wrote:
Google have made a new language.

See http://www.youtube.com/watch?v=rKnDgT73v8s

I watched the video. The language sounds like a cross between Smalltalk
and C, but with better concurrency support. I was somewhat underwhelmed,
but I do think the concurrency features are interesting.

I watched part of the video, though I'm curious enough about it that I'll 
probably
watch the rest later, esp. if Go keeps coming up around here.  However, for me
personally "normal" static typing is too rigid for just about anything.  I would
never choose a language that didn't either have duck typing or good templates 
that
basically amount to compile-time duck typing.  I'm not sure how Go addresses 
this.

See http://golang.org/doc/go_lang_faq.html#inheritance

"Rather than requiring the programmer to declare ahead of time that two types are related, in Go a type automatically satisfies any interface that specifies a subset of its methods. Besides reducing the bookkeeping, this approach has real advantages. Types can satisfy many interfaces at once, without the complexities of traditional multiple inheritance."

That, my friend, is duck typing.

Incidentally, with pure duck typing I tend to feel a little bit...naked, unconstrained. So while it's very flexible and allows any compatible types to "just work," it also makes it a little hard to define any useful constraints in practice. Smalltalk makes this a tiny bit better because of its message passing syntax (the keyword arguments make things a little more clear), but I think D strikes a nice balance with templates and metaprogramming techniques, while still having some type-constrained relationships where they make sense.

-Mike

Reply via email to