Re: C++ const expression are not that const after all

2015-04-29 Thread Jacob Carlborg via Digitalmars-d

On 2015-04-29 02:49, Walter Bright wrote:


Yes, many times, yes. Report it to bugzilla as a bug. Any code relying
on buggy behavior listed in bugzilla is likely to get little sympathy
from the D community when it breaks due to a bugfix.


The most difficult part is to figure if a weird behavior is a bug or not.

--
/Jacob Carlborg


Re: C++ const expression are not that const after all

2015-04-29 Thread Daniel Murphy via Digitalmars-d

Jacob Carlborg  wrote in message news:mhq0cq$k3h$1...@digitalmars.com...


The most difficult part is to figure if a weird behavior is a bug or not.


I don't think I'm the only one that looks at all of the new bugzilla issues. 
It might take a while, but an invalid bug in bugzilla should get closed with 
an explanation eventually.


One useful entry-level task for people who want to contribute is going 
through the new (and old) issues to add keywords, reduce test cases, add 
more informative titles and close duplicates.  This is how I got started, 
before I was contributing to the compiler. 



Re: C++ const expression are not that const after all

2015-04-29 Thread Walter Bright via Digitalmars-d

On 4/29/2015 12:14 AM, Jacob Carlborg wrote:

On 2015-04-29 02:49, Walter Bright wrote:


Yes, many times, yes. Report it to bugzilla as a bug. Any code relying
on buggy behavior listed in bugzilla is likely to get little sympathy
from the D community when it breaks due to a bugfix.


The most difficult part is to figure if a weird behavior is a bug or not.


Mutable const sure has a buggy smell about it. If it's not a bug, then someone 
will mark the bugzilla issue as invalid.




Re: C++ const expression are not that const after all

2015-04-29 Thread H. S. Teoh via Digitalmars-d
On Wed, Apr 29, 2015 at 12:06:50PM -0700, Walter Bright via Digitalmars-d wrote:
 On 4/29/2015 12:14 AM, Jacob Carlborg wrote:
 On 2015-04-29 02:49, Walter Bright wrote:
 
 Yes, many times, yes. Report it to bugzilla as a bug. Any code
 relying on buggy behavior listed in bugzilla is likely to get little
 sympathy from the D community when it breaks due to a bugfix.
 
 The most difficult part is to figure if a weird behavior is a bug or
 not.
 
 Mutable const sure has a buggy smell about it.

It's definitely an oxymoron, bug or not!


T

-- 
Those who don't understand D are condemned to reinvent it, poorly. -- Daniel N


Re: C++ const expression are not that const after all

2015-04-29 Thread deadalnix via Digitalmars-d

On Wednesday, 29 April 2015 at 07:14:34 UTC, Jacob Carlborg wrote:

On 2015-04-29 02:49, Walter Bright wrote:

Yes, many times, yes. Report it to bugzilla as a bug. Any code 
relying
on buggy behavior listed in bugzilla is likely to get little 
sympathy

from the D community when it breaks due to a bugfix.


The most difficult part is to figure if a weird behavior is a 
bug or not.


http://www.vaikan.com/wordpress/wp-content/uploads/2014/11/f763312cf3b15d96718db268c39edebf-d2z0z5x.jpg


Re: C++ const expression are not that const after all

2015-04-28 Thread Luc Bourhis via Digitalmars-d

On Tuesday, 28 April 2015 at 02:48:09 UTC, H. S. Teoh wrote:
On Tue, Apr 28, 2015 at 02:24:01AM +, deadalnix via 
Digitalmars-d wrote:

http://b.atch.se/posts/non-constant-constant-expressions/


Whoa. This is gonna give me nightmares tonight... that is 
absolutely

insane.


The author of that blog seems to see his finding in a positive 
light actually.
As it makes it possible to write more powerful template 
metaprograms!


Re: C++ const expression are not that const after all

2015-04-28 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 28, 2015 at 12:20:31PM +, Luc Bourhis via Digitalmars-d wrote:
 On Tuesday, 28 April 2015 at 02:48:09 UTC, H. S. Teoh wrote:
 On Tue, Apr 28, 2015 at 02:24:01AM +, deadalnix via Digitalmars-d
 wrote:
 http://b.atch.se/posts/non-constant-constant-expressions/
 
 Whoa. This is gonna give me nightmares tonight... that is absolutely
 insane.
 
 The author of that blog seems to see his finding in a positive light
 actually.  As it makes it possible to write more powerful template
 metaprograms!

Somebody should enlighten him concerning D. ;-)


T

-- 
Chance favours the prepared mind. -- Louis Pasteur


Re: C++ const expression are not that const after all

2015-04-28 Thread Dicebot via Digitalmars-d

On Tuesday, 28 April 2015 at 02:24:02 UTC, deadalnix wrote:
Interesting read, and the conclusion beg the question: why 
using a sublanguage for const expression, if it do not provides 
the guarantee it is supposed to.


http://b.atch.se/posts/non-constant-constant-expressions/


If someone discovers similar hole in D - please, I beg you, don't 
try building a library on top of it. Report a bug instead :)


Re: C++ const expression are not that const after all

2015-04-28 Thread Walter Bright via Digitalmars-d

On 4/28/2015 4:13 PM, Dicebot wrote:

On Tuesday, 28 April 2015 at 02:24:02 UTC, deadalnix wrote:

Interesting read, and the conclusion beg the question: why using a sublanguage
for const expression, if it do not provides the guarantee it is supposed to.

http://b.atch.se/posts/non-constant-constant-expressions/


If someone discovers similar hole in D - please, I beg you, don't try building a
library on top of it. Report a bug instead :)


Yes, many times, yes. Report it to bugzilla as a bug. Any code relying on buggy 
behavior listed in bugzilla is likely to get little sympathy from the D 
community when it breaks due to a bugfix.


Re: C++ const expression are not that const after all

2015-04-28 Thread Andrei Alexandrescu via Digitalmars-d

On 4/28/15 4:13 PM, Dicebot wrote:

On Tuesday, 28 April 2015 at 02:24:02 UTC, deadalnix wrote:

Interesting read, and the conclusion beg the question: why using a
sublanguage for const expression, if it do not provides the guarantee
it is supposed to.

http://b.atch.se/posts/non-constant-constant-expressions/


If someone discovers similar hole in D - please, I beg you, don't try
building a library on top of it. Report a bug instead :)


FWIW this is addressed as a defect by the C++ std committee. -- Andrei


Re: C++ const expression are not that const after all

2015-04-28 Thread bearophile via Digitalmars-d

Luc Bourhis:


The author of that blog seems to see his finding in a
positive light actually. As it makes it possible to write
more powerful template metaprograms!


One of the essences of modern languages is to restrict the power 
of the programmer in specific parts, to reduce unwanted 
interactions and make complexity more manageable. His finding 
seems a design mistake.


Bye,
bearophile


Re: C++ const expression are not that const after all

2015-04-28 Thread Walter Bright via Digitalmars-d

On 4/28/2015 8:16 AM, bearophile wrote:

Luc Bourhis:


The author of that blog seems to see his finding in a
positive light actually. As it makes it possible to write
more powerful template metaprograms!


One of the essences of modern languages is to restrict the power of the
programmer in specific parts, to reduce unwanted interactions and make
complexity more manageable. His finding seems a design mistake.


Most languages suffer from quirky, unexpected behaviors from interactions 
between otherwise sensible features. The awful thing, though, is programmers 
discover these things and then build a store around them, making it impossible 
to fix those quirks.




Re: C++ const expression are not that const after all

2015-04-28 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 28, 2015 at 01:56:01PM -0700, Walter Bright via Digitalmars-d wrote:
 On 4/28/2015 8:16 AM, bearophile wrote:
 Luc Bourhis:
 
 The author of that blog seems to see his finding in a
 positive light actually. As it makes it possible to write
 more powerful template metaprograms!
 
 One of the essences of modern languages is to restrict the power of
 the programmer in specific parts, to reduce unwanted interactions and
 make complexity more manageable. His finding seems a design mistake.
 
 Most languages suffer from quirky, unexpected behaviors from
 interactions between otherwise sensible features. The awful thing,
 though, is programmers discover these things and then build a store
 around them, making it impossible to fix those quirks.

Are you certain D doesn't suffer from the same problem? ;-)


T

-- 
There is no gravity. The earth sucks.


Re: C++ const expression are not that const after all

2015-04-28 Thread Steven Schveighoffer via Digitalmars-d

On 4/28/15 5:45 PM, H. S. Teoh via Digitalmars-d wrote:

On Tue, Apr 28, 2015 at 01:56:01PM -0700, Walter Bright via Digitalmars-d wrote:

On 4/28/2015 8:16 AM, bearophile wrote:

Luc Bourhis:


The author of that blog seems to see his finding in a
positive light actually. As it makes it possible to write
more powerful template metaprograms!


One of the essences of modern languages is to restrict the power of
the programmer in specific parts, to reduce unwanted interactions and
make complexity more manageable. His finding seems a design mistake.


Most languages suffer from quirky, unexpected behaviors from
interactions between otherwise sensible features. The awful thing,
though, is programmers discover these things and then build a store
around them, making it impossible to fix those quirks.


Are you certain D doesn't suffer from the same problem? ;-)


What? You haven't visited the @property store yet?

-Steve



Re: C++ const expression are not that const after all

2015-04-27 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 28, 2015 at 02:24:01AM +, deadalnix via Digitalmars-d wrote:
 Interesting read, and the conclusion beg the question: why using a
 sublanguage for const expression, if it do not provides the guarantee
 it is supposed to.
 
 http://b.atch.se/posts/non-constant-constant-expressions/

Whoa. This is gonna give me nightmares tonight... that is absolutely
insane. Yet another proof that something is fundamentally screwed up
with the C++ template system... Now I'm certain beyond any doubt that I
am *not* going back to C++, ever.


T

-- 
I see that you JS got Bach.


C++ const expression are not that const after all

2015-04-27 Thread deadalnix via Digitalmars-d
Interesting read, and the conclusion beg the question: why using 
a sublanguage for const expression, if it do not provides the 
guarantee it is supposed to.


http://b.atch.se/posts/non-constant-constant-expressions/