Thread overview
Type safety + auto = win!
Jul 27, 2012
Nathan M. Swan
Jul 27, 2012
David Nadlinger
Jul 28, 2012
Russel Winder
July 27, 2012
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.

My two cents,
NMS
July 27, 2012
You might want to turn this into a blog post. This way it'd much better usable for … ehm … propaganda purposes than a forum entry. Just sayin'. ;)

David


On Friday, 27 July 2012 at 22:18:56 UTC, 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.
>
> My two cents,
> NMS


July 27, 2012
On 7/27/12 6:25 PM, David Nadlinger wrote:
> You might want to turn this into a blog post.

Yes please.

Andrei
July 28, 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@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder