Template Metaprogramming Made Easy (Huh?)

Justin Johansson procode at adam-dott-com.au
Thu Sep 10 17:25:04 PDT 2009


Nick Sabalausky Wrote:
> As someone who's been meaning to take a look at Scala, I'm very curious: 
> What did you dislike about it?

I'm somewhat reluctant to discuss Scala too much here as this is a D forum, but since more than one person asked it's only fair to reply with something.  Now this is just my opinion, subjective and ignorant as it may be so, please, its horses for courses and YMMV.  Also I fully support bio-diversity in programming languages and it's ridiculous to suggest that there is or should be only only true language and then to can a language because its not your idea of the one true language.  Regarding my writing style, I attempt to employ a little humour (lame as it may be) so please take that into account before anyone decides to get really angry at me.

Well here goes ...

1. Moved in with her for six months.  She's an overkill of a language, seductive at first but then like a Black Widow spider eats her mate after courtship.

http://en.wikipedia.org/wiki/Latrodectus_hesperus

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

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

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

http://en.wikipedia.org/wiki/Occam%27s_razor

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.

Google for "Scala experiment" with and without the quotes and you'll soon realize she was designed in a lab from a kitchen sink full of PL body parts like her brother in fiction**.

Read Cedric's blog June 2008 for example

http://beust.com/weblog/archives/000490.html

Still there's no such thing as a "failed experiment".  An experiment is just an "experiment".  The light bulb wouldn't exist today if Edison wasn't as tenacious as he was.  He simply treated "failed" experiments as just another way of learning how not to make a light bulb.

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

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.

Read August 2009 comments by Tim at

http://blog.jayway.com/2009/03/12/scala-ide-support/

"Half a year after the above post, I’m still shocked at how badly the Scala plug-in for Eclipse behaves. I’ve downloaded several variants on Eclipse over the last half-year (currently 3.4.2), and NONE of them have been able to do even basic things reliably with the Scala plug-in (or vise-versa)
...
without, say, basic knowledge of code (how to find a referenced method) and the ability to run more than five minutes, I might as well go back to Vim. (Which I think I’m going to have to do.)"

When I went looking for an Eclipse plugin for D a few weeks ago, I soon discovered Descent.  It's not perfect by any means, but works well enough not to be a thorn in your side and deserves credit for where it's at already.

6. In agreement with comments by Tony Arcieri (April 2009)

"I was initially excited about Scala but slowly grew discontented with it."

http://www.unlimitednovelty.com/2009/04/why-i-dont-like-scala.html

To sum up, after six months of living in, I felt I still wasn't getting anywhere close to being intimate with her.  It really shouldn't take that long to get up to speed with a new PL.

My advice for D2 language designers is not to copy every "cool" feature of Scala.  For good balance of ideas, look at Rich Hickey's Clojure language.

http://clojure.org/




More information about the Digitalmars-d mailing list