Scala future, Sing#
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Tue Aug 25 08:42:07 PDT 2009
Jari-Matti Mäkelä wrote:
> bearophile wrote:
>
>> As Sing# (http://en.wikipedia.org/wiki/Sing_sharp ) and Chapel, Scala is
>> one of the languages to be followed more, because they share some of
>> future purposes of D2/D3.
>>
>> A small presentation about the close future of Scala (it's not a general
>> introduction to Scala): "Scala -- The Next 5 Years" by Martin Odersky:
>> http://www.scala-lang.org/sites/default/files/odersky/scalaliftoff2009.pdf
>
> Scala is an impressive language and overall well designed. There are
> certainly truckloads of features that could be taken from Scala to D. But
> I'm afraid that the desire to have familiarity and compatibility with the
> C/C++ family is more important in this community than cool new functional
> features. Here's a quick comparison of some factors:
[snip]
You are making very good points, thanks for an insightful post. A few of
them are slightly inaccurate, but those were discussed by Walter
already. I'd like to make a few high-level comments.
I find the lack of rigor in certain parts of D as damaging as you do.
Fortunately, that has improved by leaps and bounds and is still
improving. When I joined Walter with working on D back in 2006, D was
quite a lot less theoretically-motivated - it was all greasy nuts and
bolts and pegs hammered in place. There was a tacit agreement between
Walter and me that D will improve the rigor of its ways, and indeed we
have made strides in that respect. If things work out properly, we'll be
able to define SafeD - a proper, checkable safe subset of the language.
It would be great if there were more PL heavyweights in the D community
(as you mention there are in Scala), but D's community is in large part
young and enthusiastic, and that's an asset. Possibly some of the young
students using D will become PL experts themselves and help improve it.
(Unlike you, I think that by and large there is no hatred or shunning of
the ivory tower.) Among other things, it would be great if you yourself
hung out more around here. It's a risky proposition, but I guess it's a
simple fact that you have a better chance at making a vital contribution
to D than to Scala.
About unifying FP and OOP, I hope you can educate me a bit. My
understanding from a cursory search is that Scala does not have true
immutability and purity, only Java-style by-convention immutability a la
String class. Is that correct? If that's the case, I think Scala got the
syntactic sugar part of FP right (pattern matching) but not the purity
and immutability aspects, which I believe are much more important. These
aspects are related to concurrency as well, where I think Scala has a
distinctly underwhelming lineup. Even with what we know we can implement
now in D concurrency-wise, we'll be in better shape than many (most?
all?) other languages. Stay tuned.
I agree that D could improve its type deduction - it doesn't even do
Hindley-Milner. (Incidentally, you chose a particularly poor example
regarding the type of array literals - those are very easy to type
properly (and in fact I do so with a library function), but Walter
insisted that typing by the first member is simple enough for people to
understand and remember.) I'm afraid D's type deduction abilities will
stay at about this level at least for D2. The good news is that, due to
templates' deferred typechecking, I haven't found that to be a huge
problem in practice.
Andrei
More information about the Digitalmars-d
mailing list