April 27, 2008
Steven Schveighoffer wrote:
> "Walter Bright" wrote
>> http://www.digitalmars.com/d/1.0/changelog.html
>> http://ftp.digitalmars.com/dmd.1.029.zip
>>
>> This starts laying the foundation for multiprogramming support:
>>
>> http://www.digitalmars.com/d/2.0/changelog.html
>> http://ftp.digitalmars.com/dmd.2.013.zip
> 
> "Hidden methods now get a compile time warning rather than a runtime one."
> 
> Yay!
> 

*sigh of relief*


-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
April 27, 2008
Sean Kelly wrote:
>  As for the C++0x discussions, I feel
> that some of the participants of the memory model discussion are experts
> in the field and understand quite well the issues involved.
> 
> 
> Sean

Are you talking about some actual online discussion? If so, can you point to where it is? (comp.lang.c++ maybe?)

Ever since I read about the double-checked locking pattern, that I've
felt as if the carpet was pulled under my feet (even though I never used the pattern), as it clearly illustrated how tricky the memory model concurrency issues are.
Speaking of which, is a memory model specification also being worked out for D, since the concurrent programming aspects of the language are being developed?

-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
April 27, 2008
Walter Bright wrote:
> there wondering "what's a cubit". 

I tried to look up that term. Did you mean a "cubit" or a "qubit"?

-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
April 27, 2008
Walter Bright wrote:
> 
> http://www.digitalmars.com/d/2.0/changelog.html

In addition, it seems that now the order of evaluation is less undefined. The following was added in http://www.digitalmars.com/d/2.0/expression.html

"The following binary expressions are evaluated in strictly left-to-right order:

OrExpression, XorExpression, AndExpression, CmpExpression, ShiftExpression, AddExpression, CatExpression, MulExpression, CommaExpression, OrOrExpression, AndAndExpression "

Also added:
"Associativity and Commutativity
An implementation may rearrange the evaluation of expressions according to arithmetic associativity and commutativity rules as long as, within that thread of execution, no observable different is possible.

This rule precludes any associative or commutative reordering of floating point expressions."
Walter, note the different->difference typo.


Some additions to the float page as well.


And a new FAQ question was added:
"Can't a sufficiently smart compiler figure out that a function is pure automatically?"
http://www.digitalmars.com/d/2.0/faq.html#pure


-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
April 27, 2008
Bruno Medeiros wrote:
> 
> And a new FAQ question was added:
> "Can't a sufficiently smart compiler figure out that a function is pure automatically?"
> http://www.digitalmars.com/d/2.0/faq.html#pure
> 

This FAQ entry was made in response to the suggestion someone made that pure be automatically detected by the compiler.

But I think the suggestion made wasn't to remove the pure attribute, and make the compiler detect *all* pure functions. One would still be able to use the pure function parameter. That would invalidate points 1 and 3.
As for 2: well, just don't do automatic pure detection for virtual functions (unless they are final).

-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
April 27, 2008
Bruno Medeiros wrote:
> Speaking of which, is a memory model specification also being worked out for D, since the concurrent programming aspects of the language are being developed?

Yes.
April 28, 2008
Bruno Medeiros wrote:
> Bruno Medeiros wrote:
>>
>> And a new FAQ question was added:
>> "Can't a sufficiently smart compiler figure out that a function is pure automatically?"
>> http://www.digitalmars.com/d/2.0/faq.html#pure
>>
> 
> This FAQ entry was made in response to the suggestion someone made that pure be automatically detected by the compiler.
> 
> But I think the suggestion made wasn't to remove the pure attribute, and make the compiler detect *all* pure functions. One would still be able to use the pure function parameter. That would invalidate points 1 and 3.
> As for 2: well, just don't do automatic pure detection for virtual functions (unless they are final).

Yes that was indeed one of the things I was thinking.
But imagine function A is not declared pure, but just happens to be so.
Programmer B discovers that and starts to rely on it as a pure function.
Programmer of A later makes an enhancement that kills the purity of A, but he never intended A to be pure so he doesn't notice or care.
Programmer B updates library and subsequently is heard to utter the phrase "!*$#*%^!$&@#".

So I think I have to agree that if you're going to have pure functions in a mixed procedural/functional world, then explicit labeling is probably unavoidable.

However, it may still be useful to have tools that discover and recommend tagging of functions which are in fact pure.  Same goes for nothrow.

Anyway, I would really like for there to be some way to gain the benefits of these attributes without me having to think about it.  There are already more than enough dimensions of the problem space to keep in mind when writing programs without adding more, like pure and nothrow do.

--bb

April 28, 2008
Bruno Medeiros wrote:
> Walter Bright wrote:
>> there wondering "what's a cubit". 
> 
> I tried to look up that term. Did you mean a "cubit" or a "qubit"?
> 

Probably he's referring to this:
http://www.google.com/search?hl=en&q=what%27s+a+cubit&btnG=Google+Search

A classic American comedy monologue by Bill Cosby.

--bb
April 28, 2008
Bruno Medeiros wrote:
> Sean Kelly wrote:
>>  As for the C++0x discussions, I feel
>> that some of the participants of the memory model discussion are experts
>> in the field and understand quite well the issues involved.
>>
>>
>> Sean
> 
> Are you talking about some actual online discussion? If so, can you point to where it is? (comp.lang.c++ maybe?)

It was done via a listserv.  I don't recall offhand where the archives are.

> Speaking of which, is a memory model specification also being worked out for D, since the concurrent programming aspects of the language are being developed?

I'm guessing there is, but since Walter appears opposed to atomics in the language, your guess is as good as mine what it will be.  I had been expecting that D would copy C++0x here.


Sean
April 28, 2008
在 Thu, 24 Apr 2008 23:35:24 +0800,Steven Schveighoffer <schveiguy@yahoo.com> 写道:

> "Walter Bright" wrote
>> http://www.digitalmars.com/d/1.0/changelog.html
>> http://ftp.digitalmars.com/dmd.1.029.zip
>>
>> This starts laying the foundation for multiprogramming support:
>>
>> http://www.digitalmars.com/d/2.0/changelog.html
>> http://ftp.digitalmars.com/dmd.2.013.zip
>
> "Hidden methods now get a compile time warning rather than a runtime one."
>

shit! I've spent a lot of effort on debugging my legacy d1.0 code while I port to d2.0 with this new feature. Yet hidden method is good, runtime error is correct, current warning is awesome, just original code is bad :(
I think I need to do more change to my code to take advantage of d2.0 features , then commit.

> Yay!
>
> The pure function description needs a lot more filling out.  I'm
> particularly interested in whether mutable heap data can be created and used
> from inside a pure function, and how that would work with class
> constructors.  I won't poke you any more, because you did qualify that they
> aren't really implemented yet :)
>
> Nice work!
>
> -Steve
>
>



-- 
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/