More precise GC

William T. Fnk wtfmail at somewheredomain.net
Sun Mar 28 08:18:05 PDT 2010


bearophile Wrote:

> William T. Fnk:
> >This is a rather ridiculous way of emulating algebraic data types<
> 
> I think algebraic data types in Haskell don't allow you to use for example enums with no tags, where the tag is stored in the less significant bit of the pointer that points to the enum.
> And I think algebraic data types will not be added to D, while normal not-GC-precise enums will be kept in D, so...

Why not? Are you scared of the functional language stigma? D is already functional enough. It can't possibly get any worse. I can already write pure functional monads with the ugly D2 closure syntax. The language is already ruined in the eyes of practical imperative coders.

How I see this is that features like algebraic datatypes are questioning the authority. You have a holy mission to prove that a practical language can be built without such basic features. It indeed can be built, but you need ways to emulate the behavior since it is pretty crucial and common in practical applications. You already emulate it in your code example. And it looks bad.

The problem is two-fold, there are newbie users in the community who have no idea what an algebraic data type is. And then there are some more or less arrogant (actually there's only one person whose arrogance exceeds anything I've ever seen) language designers who recently studied the algebraic datatype article from wikipedia. They just don't want to admit they didn't know it before. And it's getting harder and harder to admit that mistake.

> 
> 
> >and value-oriented programming.<
> 
> I don't know what this is.

You need to study more SPJ videos, slides & articles..

> 
> Bye,
> bearophile




More information about the Digitalmars-d mailing list