null references redux + Looney Tunes

Lutger lutger.blijdestijn at gmail.com
Sun Oct 4 02:51:13 PDT 2009


language_fan wrote:

> On Sat, 03 Oct 2009 16:39:29 -0400, Justin Johansson wrote:
> 
>> People might remember that when I picked up D and joined this forum just
>> some 3 or so weeks ago I made mention of being a Scala refugee.***  When
>> asked what I didn't like about Scala I commented about there being too
>> many language constructs.
> 
> Compared to D that is not even true. The Scala language spec lists 40
> keywords + 10 additional reserved tokens. D 2.0 spec lists 106 keywords +
> a bit over 60 reserved tokens. In general there are no features in Scala
> that are not built around those keywords and tokens. The keywords and
> token are not more heavily overloaded than in D, on the contrary in my
> subjective opinion.
>
> So how I see things is that the language core in Scala is about 75%
> smaller, faster to learn, and easier to reason about. I have to admit
> that the features often are more powerful than in D. You need to
> recognize concepts like contra/co/invariance, higher order functions and
> kinds, and algebra that is based on terms discussed in lambda calculus
> books.

How do you think Scala is going to manage to be a popular alternative for 
Java by requiring its user to read books about lambda calculus?

The keyword metric is so flawed you just cannot base any argument around it.

Take for example the debug statement in D. It's very unorthogonal, basically 
just the same as version(debug). D is a syntax heavy language, but a lot of 
that come from such simplistic features. Heck, you could built a whole 
programming language with the number of tokens D reserves specially for 
stuff around floating point types! But they make the language only slightly 
more complicated by requiring the programmer to remember a few more words 
and meanings that don't interact so heavily with other features. 
Contrast this to say, the interaction because the C preprocessor and C++ 
template system or the various meanings of const in C++. Now that makes a 
language more *complex*.

If you want to measure the 'size' of a language (what does that mean by the 
way?) not all tokens should weigh equal. 

I highly recommend this short and subjective article on the subject by 
Yukihiro Matsumoto: "Treating Code as an Essay" from the book Beautiful 
Code. Unfortunately I couldn't find it online.










More information about the Digitalmars-d mailing list