Message Passing and Shared Data

dsimcha dsimcha at yahoo.com
Mon Apr 11 10:31:40 PDT 2011


== Quote from bearophile (bearophileHUGS at lycos.com)'s article
> dsimcha:
> > and because D2's type system is already way
> > too complex and I think piling more on is a terrible idea.
> (To me D type system seems less complex than the Scala one). To implement this
type system feature you need some work and time, and it's not nice to waste this
work, but here I'd like this type system extension to be optionally available in D
(active with a compilation switch), to try it and see how much good/bad it is, to
refine its design and find a possible acceptable one, etc.
> In Haskell there are several such optional extensions:
> http://cvs.haskell.org/Hugs/pages/hugsman/exts.html
> Bye,
> bearophile

Yes and this is why Haskell is widely regarded as "too academic".  (I don't know
as much about Scala.)  The problem with fancy type system solutions is that they
will always be conservative and making them less conservative seems to quickly
increase their complexity.  The halting problem makes a lot of decisions
undecidable in the general case and even where they're in principle decidable,
interprocedural analysis is hard.  D's type system often relies on programmer
discipline to propagate "local" information to a "global" level by using the
proper type constructors and annotations.  This scales about as well as the
discipline to do things by convention.  The result is that the type system very
frequently gets in the way and nags the programmer with pedantic issues rather
than helping, because someone forgot to mark something with the proper annotation.


More information about the Digitalmars-d mailing list