Is D a cult?

retard re at tard.com.invalid
Sun Mar 7 05:49:15 PST 2010


Sun, 07 Mar 2010 14:12:14 +0100, Lutger wrote:

> retard wrote:
> 
>> Sun, 07 Mar 2010 05:05:03 +0000, BCS wrote:
>> 
>>> Hello Jane,
>>> 
>>>> Is D a cult?
>>>> 
>>>> 
>>> No, not yet. Walter hasn't figured out how to brain wash people over a
>>> newsgroup yet. However I think Andrei's working on it and Don should
>>> have a patch in time for TDPL going out ;b
>> 
>> FWIW, I think there is a kernel of truth in the original claim. People
>> tend to agree evey time Walter proposes a new feature such as built-in
>> regexps - yes, they were removed shortly afterwards. But when
>> bearophile or some retard propose some features from functional
>> languages that are natural extensions to existing ones, everyone hates
>> them and tells us to go back to our ivory towers.
> 
> That's weird, I don't see this at all. Maybe you focus too much on one
> or two negative comments?
> 
> I also don't understand that you think D designers have a bias against
> functional programming, especially since the majority of the features
> that have been implemented the last years are heavily influenced by that
> style of programming.

Uh, majority of the features? From http://www.digitalmars.com/d/2.0/
features2.html:

> opAssign can no longer be overloaded for class objects.

nope

Added pure keyword.

[1]

> Extended enums to allow declaration of manifest constants.

nope

>Added const/immutable structs, classes and interfaces.

[1]

>Added const and immutable to IsExpressions.

nope

>Added typeof(return) type specifier.

[2]

>Added overloadable unary * operation as opStar().

nope

>Full closure support added.

ok, but this is nothing special (c++0x, c# 3.5, java7, vb.net and 
everyone else already has this very basic feature)

>Transformed all of string, wstring, and dstring into immutable 
definitions

[1]

>Added Overload Sets for functions and templates.

nope

>std.math.sin, cos, tan are now evaluated at compile time if the argument 
is a constant.

nope

>Added C++ interface for 'plugins'.

nope

>Changed result type of IsExpression from int to bool.

nope

>Added optional TemplateParameterList to IsExpression.

nope

>Added warning when override is omitted.

nope

>Added new syntax for string literals (delimited, heredoc, D tokens)

nope

>Added __EOF__ token

nope

>Added D_Version2 predefined identifier to indicate this is a D version 
2.0 compiler

nope

>Added .idup property for arrays to create immutable copies.

[1]

>Added transitive const and immutable.
in parameter storage class now means scope const.

[1]

>class and struct invariant declarations now must have a ().

nope

>Added isSame and compiles to __traits.

nope

>Added ForeachRangeStatement

Can't really tell whether this is functional or not. I know that C# LINQ 
(ZF expressions) can be considered a functional construct, but D2 foreach 
isn't really the same.

Let's see what features I had in mind:

- Algrebraic data types
- Pattern matching (extension to enum/string/integer accepting switch)
- Higher kinded types
- Tuples (no auto-folding, real product types)
- Built-in variants (real sum types)
- Currying, lazy evaluation
- Fusion optimizations (e.g. list and stream fusion)
- Type classes
- basic control constructs are expressions, not statements (e.g. unify if-
then-else and : ? into a functional if-then-else)
- better syntax for lambdas


[1] if immutability is considered functional
[2] if type inference is considered functional



More information about the Digitalmars-d mailing list