Website message overhaul

Timon Gehr timon.gehr at gmx.ch
Tue Nov 15 14:47:20 PST 2011


On 11/15/2011 11:16 PM, Daniel Gibson wrote:
> Am 15.11.2011 22:54, schrieb Walter Bright:
>> On 11/15/2011 1:31 PM, Daniel Gibson wrote:
>>> Scala is also termed a "multi-paradigm programming language", see
>>> http://en.wikipedia.org/wiki/Scala_(programming_language)
>>
>> Scala's multi-paradigms are OOP and functional.
>>
>> Yet it doesn't support function purity or immutable data. Having a
>> syntax for lambdas doesn't make a language functional. I know few people
>> share my opinion about that, but it seems that functional is used a lot
>> as a buzzword.
>
> I have never used Scala but only heard about it and skimmed over the
> wikipedia article.
> Technically it may not support functional programming because it lacks
> function purity and immutable data, but judging from the code example it
> has the look and feel of functional programming - the qsort example
> (which is no real quicksort of course) looks very much like Haskell
> (pattern matching etc).
>
> D2 on the other hand support pure functions and immutable data, but it
> doesn't look and feel like a "normal" functional language.
> I guess people used to OO programming, (C++-style) Metaprogramming or
> imperative programming feel at home with D and its support for "their"
> paradigms, but people coming from Haskell or similar languages will
> probably have a hard time using their style of code with D2

That is partly because the current GC cannot handle huge loads of tiny, 
short-lived objects as well as deeply linked data structures. And 
because strictly immutable (or even just const, for that matter) data 
does not pair well with lazy evaluation. I don't really like the fact 
that D reserves the 'lazy' keyword to mean call by name, there would be 
some nice potential in actually supporting lazy evaluation.

> - while they probably feel more at home with Scala, even though D2 supports real
> functional programming and Scala doesn't.
>

I think referential transparency is also quite useful for FP, but it is 
impossible to support without lazy evaluation.



More information about the Digitalmars-d mailing list