Jump to page: 1 2
Thread overview
C++ const expression are not that const after all
Apr 28, 2015
deadalnix
Apr 28, 2015
H. S. Teoh
Apr 28, 2015
Luc Bourhis
Apr 28, 2015
H. S. Teoh
Apr 28, 2015
bearophile
Apr 28, 2015
Walter Bright
Apr 28, 2015
H. S. Teoh
Apr 28, 2015
Dicebot
Apr 29, 2015
Walter Bright
Apr 29, 2015
Jacob Carlborg
Apr 29, 2015
Daniel Murphy
Apr 29, 2015
deadalnix
Apr 29, 2015
Walter Bright
Apr 29, 2015
H. S. Teoh
April 28, 2015
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/
April 28, 2015
On Tue, Apr 28, 2015 at 02:24:01AM +0000, 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.
April 28, 2015
On Tuesday, 28 April 2015 at 02:48:09 UTC, H. S. Teoh wrote:
> On Tue, Apr 28, 2015 at 02:24:01AM +0000, 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!
April 28, 2015
On Tue, Apr 28, 2015 at 12:20:31PM +0000, 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 +0000, 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
April 28, 2015
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
April 28, 2015
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.

April 28, 2015
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.
April 28, 2015
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

April 28, 2015
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 :)
April 28, 2015
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
« First   ‹ Prev
1 2