Template Metaprogramming Made Easy (Huh?)

language_fan foo at bar.com.invalid
Fri Sep 11 01:38:35 PDT 2009


Thu, 10 Sep 2009 20:25:04 -0400, Justin Johansson thusly wrote:

> 2. Scala cannot make up her mind if she's a scripting language or
> serious language.  Optional semicolons at the end of statements are
> really frustrating for code style consistency.  Worst when sometimes you
> need them and you left them out everywhere else for code style
> consistency.  (JavaScript has this problem too and JS guru Douglas
> Crockford recommends semicolons always be used in that language despite
> them being optional when statements clearly separated by newlines.)

Ok, so you did not like optional semicolons.

> 
> 3. Half-baked embeddable XML support in the language looks like she
> borrowed from ECMAScript's E4X.

Ok, borrowing features is bad.

> 
> 4. Too many different ways of doing things.  All very interesting and no
> doubt very clever but she needs to shave her hairy legs with Occam's
> razor before she starts to look like the sister of Frankenstein's
> monster**.

Examples? I can tell you that D has too many looping constructs: goto, 
for, foreach, foreach_reverse, do-while, while, recursive functions, 
recursive templates.

> 4. Way too much of an academic approach to language design; appears to
> be a grand experiment to see how many academic papers can be derived
> from it.

Ok, academic research is bad.

> 5. Newcomers to the language will find it's type system concepts
> overwhelming - co-variance and contra-variance etc.  (don't know how D2
> will address this better though). Yes these issues are important for OO
> libraries but feel there must be a more practical way out of the
> language complexity.  Personally I always kept away from the hairy and
> scary bits of C++; you don't need 'em in a practical language.

I know many professional Java/C# coders who know the concepts of 
variances. The concepts are not new.. have you ever written code in Java 
(? extends Foo) etc. ? Java is a simple language, much simpler than D and 
even in Java land you need to care about these. I have also heard C++ 
developers pondering these issues. Giving them the proper names comes 
from the academia, though.

> I've heard Scala's argument that all the complexity is hidden in the
> libraries so need to worry about it.  Unfortunately I don't believe her.
>  I learn a lot about a language by studying the library code and expect
> it to be as easy to read and understand as mainline code.

It is. The core language does not have e.g. arrays or AAs. Library code 
is known to be much more complex than ordinary application code.

I would not recommend studying a new language by reading the sources of 
libraries. It is like trying to learn quick-sort by reading the sources 
of JVM, ffmpeg or the Linux kernel. For instance there is the book 
'Programming in Scala', which is much better a starting point as the 
language also has some theoretical prerequisites. Reading the library 
code gets easier after reading the book.

> 5. Not her fault (i.e. of the language), but after six months of
> courting Scala with the Eclipse plugin, suffering IDE crash after crash
> and lost code I just could not bring myself to suffering her any longer.

When Descent was new, it also sucked. It used to hang badly when it 
parsed partial code, like when one did not yet have a closing bracket for 
arrays. The Netbeans plugin for Scala is more stable.



More information about the Digitalmars-d mailing list