Andrei Alexandrescu Wrote:

> 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.

That's great to hear.
 
> 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. 

That's more likely. I can see why the approach doesn't attract PL post-grad 
students, but that's not necessarily a huge problem.

> (Unlike you, I think that by and large there is no hatred or shunning of 
> the ivory tower.)

I've experienced this kind of attitude in the D's irc channel and sometimes 
here on the newsgroup. It's quite understandable that since D consists of so 
many heterogenic features, different kinds of aspects motivate us. To me the 
coherent "user interface" of the language and its semantics are one of the 
appealing sides, but for some other people things like backend optimizations 
and compatibility with existing C/C++ libraries matters more and e.g. rigorous 
language semantics are just bikeshedding.

I have little problem reading or writing code written in a cryptic unorthogonal 
language - on the contrary I sometimes find it an exciting way of spending 
time. But when I sometimes suggest some feature or change in semantics, my goal 
is to make the language easier to use for all of us.

> 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.

I do hang out here, have done so since 2003. And I have some hopes that D 
becomes useful for me again. I've liked the direction D2 is heading towards, 
and once the largest problems have been ironed out, I might actually start 
using it (or D3), and I'm sure there are others who will do the same.

> 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.

It doesn't have a system similar to what D2 has, but the Java-style 
immutability is used to provide e.g. immutable collections. I'm expecting a 
change here later when the concurrency becomes a larger issue (it should be 
already, but you only have so much time!). I've done some research on 
concurrency issues lately and it seems to me that there are so many 
computational models to choose from that in some sense it might be too early to 
stick with one.

> 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.

Agreed, it's not a pure functional language. In fact the functional feel is 
quite different from the old school functional languages.

> 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.

Yea, I did some other tests and it really seems the type inference has gotten 
much better. It just felt dishonest to claim something without providing 
examples. I expected more problems, but was happy to see that many cases indeed 
worked now.

Reply via email to