Thread overview
Re: Pure functions in D
Sep 23, 2008
Josh Szepietowski
Sep 23, 2008
Mosfet
Sep 23, 2008
Ary Borenszweig
Sep 23, 2008
Bruno Medeiros
Sep 27, 2008
Walter Bright
September 23, 2008
Walter Bright Wrote:

> Knud Soerensen wrote:
> > When are pure functions coming to dmd ?
> 
> They're about half-implemented. Given the unexpected huge interest in this, I'll have to bump up the priority!

Fantastic news! I must reveal that pure functions are the "killer feature" in D2.0 for me, personally.
September 23, 2008
Josh Szepietowski wrote:
> Walter Bright Wrote:
> 
>> Knud Soerensen wrote:
>>> When are pure functions coming to dmd ?
>> They're about half-implemented. Given the unexpected huge interest in this, I'll have to bump up the priority!
> 
> Fantastic news! I must reveal that pure functions are the "killer feature" in D2.0 for me, personally.

Don't really understand why this feature is so important while there are so many things to achieve.
September 23, 2008
Mosfet wrote:
> Josh Szepietowski wrote:
>> Walter Bright Wrote:
>>
>>> Knud Soerensen wrote:
>>>> When are pure functions coming to dmd ?
>>> They're about half-implemented. Given the unexpected huge interest in this, I'll have to bump up the priority!
>>
>> Fantastic news! I must reveal that pure functions are the "killer feature" in D2.0 for me, personally.
> 
> Don't really understand why this feature is so important while there are so many things to achieve.

True. They won't boost your productivity. They won't free you from bugs. They will just enhance your application's performance.
September 23, 2008
Ary Borenszweig wrote:
> Mosfet wrote:
>> Josh Szepietowski wrote:
>>> Walter Bright Wrote:
>>>
>>>> Knud Soerensen wrote:
>>>>> When are pure functions coming to dmd ?
>>>> They're about half-implemented. Given the unexpected huge interest in this, I'll have to bump up the priority!
>>>
>>> Fantastic news! I must reveal that pure functions are the "killer feature" in D2.0 for me, personally.
>>
>> Don't really understand why this feature is so important while there are so many things to achieve.
> 
> True. They won't boost your productivity. They won't free you from bugs. They will just enhance your application's performance.

And even on the performance front I'm a bit skeptical on how well it can be used in practice.
So I do agree that this is really not one of the most important features  of D, and even if it's very important for concurrency, to succeed D still needs to get the basics of a language done right, and there is still much other work to be done here.

But there is one advantage in having pure and other extensive reforming features implemented as soon as possible, which is to prevent future major breaking changes in the language... We've all seen the rift D2's const has created, so the more overhauls that get done ASAP, the better. But we must settle down sometimes, and never forget the other important pending issues D has.


-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
September 27, 2008
Ary Borenszweig wrote:
> True. They won't boost your productivity. They won't free you from bugs. 

I disagree. Pure functions increase productivity and reduce the scope of bugs by providing statically enforcible constraints on what a function can do. This reduces the cognitive load on the programmer.