Go vs. D [was Re: Rust vs Dlang]

Russel Winder russel at winder.org.uk
Sun Mar 17 03:01:00 PDT 2013


On Sun, 2013-03-17 at 09:17 +0100, Paulo Pinto wrote:
[…]
> The first known one is that Go is the only strong typed language to 
> eschew generics in the 21st century.

On the other hand, perhaps generics is not a good thing, yet has created
an unchallenged mindset? NB I am tainted by C++ templates and generics
on the JVM both of which really suck as far as I am concerned – C# has
much less of a problem here, and Scala hacks it's way around it. Also I
use Python a lot which has only one variable type, reference to object.
Heterogeneity is not your enemy.

I like the experiment of objects as values with methods added as needed,
very Pythonic. Go even makes this static compile time type checked;
though I think they miss the underlying irony of this.

Far too many "object oriented" languages have forgotten that the
computational model is one of sending messages to objects asking them to
undertake a behaviour.  Statically typed languages constrain objects not
to be able to evolve their behaviours.

> For the rest, copying from my discussion on Lambda the Ultimate about 
> C++ developers not jumping into Go 
> (http://lambda-the-ultimate.org/node/4554#comment-71504):
> 
> - exceptions;
> - enumerations;
> - generic types;
> - direct use of OS APIs, without the need of writing wrappers;
> - currently only static compilation is available;
> - due to static compilation only model, there are issues with 3rd party 
> code;
> - no support for meta-programming;
> - rich set of available libraries;
> - the PR about go routines and channels, usually forgets to mention that 
> similar features do exist as libraries for other languages

Go is a stripped down C with stronger type checking. memory management
and CSP. This actually makes it an important language in the scheme of
things, even if I agree with you that in so many way it is a regression
into the 1960s.

The major problem for all statically compiled languages is the reliance
on hardware integers.

> I know you can fake enumerations with typed consts, but it is not the 
> same thing as real enumerations.

On the other hand C and C++ enumerations are just syntactic sugar for
the same thing so not real difference. In fact exactly the opposite,
they are a delusion. Conversely Java enumerations are a bit heavyweight.

> My point about direct OS APIs is that while D and Rust follow the 
> approach used by other languages where you just declare bindings, Go 
> forces the use of the CGO tool and a C compiler that speaks Go ABI.

I guess this is because of the segmented stacks architecture behind the
realization of Go.

> Their talk about fast compilation is also quite effective with young 
> developers that did not grew up with Modula-2 and Mac/Turbo Pascal or 
> using other compiled languages with modules, so they think Go is the 
> first compiled language to offer that.
> 
> Feel free to destroy. :)

Far from it. I think Go is a significant improvement over C, but that in
2013 applications programmers should be using something better. I
continue to be surprised by Python people moving to Go. The only
"positive" for Go is goroutines. Python's GIL's days are numbered at
which point even that issue goes away.

The issue is then how to make D appealing to Python programmers. People
need to convince me why I should stop training people to use Python.
This will be hard given that C/C++/Python is now the standard model for
computational systems.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20130317/94f39e9f/attachment.pgp>


More information about the Digitalmars-d-announce mailing list