Type safety + auto = win!

Russel Winder russel at winder.org.uk
Sat Jul 28 00:09:45 PDT 2012


On Sat, 2012-07-28 at 00:18 +0200, Nathan M. Swan wrote:
> A story:
> 
> Playing around with functional programming, I started trying to 
> implement interesting functions in Lisp. It all went well until 
> "permute", a function which isn't that complicated but involves 
> lists, lists of lists, and lists of lists of lists. This was so 
> confusing and complicated that I gave up.
> 
> More recently, I tried it again in Haskell. It took less than 
> twenty minutes! The reason was Haskell's type declarations, which 
> made it so much easier to think about what was going in and out.
> 
> How this relates to D:
> 
> The type system can often get annoying, and become a pain (e.g. 
> Java), hence the popularity of dynamic typing 
> (Python/Ruby/Ecmascript). But when thinking about complicated 
> algorithms and systems, they are a great structuring force. Which 
> is part of why I love D: "auto" and "Variant" lets you forget 
> about a lot of it, but you can still be explicit when it is 
> important.

As David and Andrei suggest, it would be good to turn this into a blog
post, especially if you could add some code snippets.

I would chip in that Groovy is a dynamically typed language on the JVM
that is treading the "optionally typed" route and experimenting with
mixed dynamically typed, statically type, dynamically bound and
statically compiled. This is a real eye opener for me as I really like
the lightweightness of dynamically typed language, despite the
uncertainty of what a program means, but I need the speed of statically
compilation of the computationally intensive bits of code.

If D can have the programming lightweightness of Groovy, Python and
(J)Ruby, with the power and expressiveness of Haskell and yet still
compete with C++ then there is a win. However D's marketing needs to be
on blogs, articles in journals (online or otherwise) as well as in this
mailing list. Hence trying to get everyone to write about D and their
experience with D.
 
-- 
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/attachments/20120728/6cb375fb/attachment.pgp>


More information about the Digitalmars-d mailing list