April 25, 2015
On Saturday, 25 April 2015 at 21:26:25 UTC, Andrei Alexandrescu wrote:
> On 4/22/15 1:36 PM, John Colvin wrote:
>>
>> Is it even possible to contrive a case where
>> 1) The default initialisation stores are technically dead and
>> 2) Modern compilers can't tell they are dead and elide them and
>> 3) Doing the initialisation has a significant performance impact?
>>
>> The boring example is "extra code causes instruction cache misses".
>
> I've seen statically-sized arrays causing problems. -- Andrei

Care to outline an example?
April 26, 2015
On 4/25/15 3:23 PM, John Colvin wrote:
> On Saturday, 25 April 2015 at 21:26:25 UTC, Andrei Alexandrescu wrote:
>> On 4/22/15 1:36 PM, John Colvin wrote:
>>>
>>> Is it even possible to contrive a case where
>>> 1) The default initialisation stores are technically dead and
>>> 2) Modern compilers can't tell they are dead and elide them and
>>> 3) Doing the initialisation has a significant performance impact?
>>>
>>> The boring example is "extra code causes instruction cache misses".
>>
>> I've seen statically-sized arrays causing problems. -- Andrei
>
> Care to outline an example?

Many examples have to do with sentinel-terminated buffers. Start with e.g.

char buf[1024] = void;
buf[0] = 0;
...

The rest of the function makes sure it keeps the invariant that the buffer is zero-terminated. This is difficult for compilers to divine (never saw any to do so). So you have either code that's officially unsafe because it uses uninitialized data, or slow code because it zeroes the entire kilobyte.

No more need to get into details here, because... IT'S HACKATHON TIME! I'll post my ideas next.


Andrei

April 26, 2015
On Wednesday, 22 April 2015 at 19:51:23 UTC, ponce wrote:
>
> I should put in in a d-idioms anyway.
>

http://p0nce.github.io/d-idioms/#How-does-D-improve-on-C++17?
April 26, 2015
On Sunday, 26 April 2015 at 09:26:11 UTC, ponce wrote:
> On Wednesday, 22 April 2015 at 19:51:23 UTC, ponce wrote:
>>
>> I should put in in a d-idioms anyway.
>>
>
> http://p0nce.github.io/d-idioms/#How-does-D-improve-on-C++17?

excellent.

I linked it here: http://wiki.dlang.org/Coming_From

April 26, 2015
On Sunday, 26 April 2015 at 12:04:20 UTC, Laeeth Isharc wrote:
> On Sunday, 26 April 2015 at 09:26:11 UTC, ponce wrote:
>> On Wednesday, 22 April 2015 at 19:51:23 UTC, ponce wrote:
>>>
>>> I should put in in a d-idioms anyway.
>>>
>>
>> http://p0nce.github.io/d-idioms/#How-does-D-improve-on-C++17?
>
> excellent.
>
> I linked it here: http://wiki.dlang.org/Coming_From

Luke 4:24 "nobody is prophet in his own country"

http://www.reddit.com/r/programming/comments/33x6lj/how_does_d_improve_on_c17/

April 26, 2015
On Sunday, 26 April 2015 at 14:28:11 UTC, Baz wrote:
> On Sunday, 26 April 2015 at 12:04:20 UTC, Laeeth Isharc wrote:
>> On Sunday, 26 April 2015 at 09:26:11 UTC, ponce wrote:
>>> On Wednesday, 22 April 2015 at 19:51:23 UTC, ponce wrote:
>>>>
>>>> I should put in in a d-idioms anyway.
>>>>
>>>
>>> http://p0nce.github.io/d-idioms/#How-does-D-improve-on-C++17?
>>
>> excellent.
>>
>> I linked it here: http://wiki.dlang.org/Coming_From
>
> Luke 4:24 "nobody is prophet in his own country"
>
> http://www.reddit.com/r/programming/comments/33x6lj/how_does_d_improve_on_c17/

Lesson taken: should have put a less aggressive title.
April 27, 2015
On Sunday, 26 April 2015 at 19:13:33 UTC, ponce wrote:
> On Sunday, 26 April 2015 at 14:28:11 UTC, Baz wrote:
>> On Sunday, 26 April 2015 at 12:04:20 UTC, Laeeth Isharc wrote:
>>> On Sunday, 26 April 2015 at 09:26:11 UTC, ponce wrote:
>>>> On Wednesday, 22 April 2015 at 19:51:23 UTC, ponce wrote:
>>>>>
>>>>> I should put in in a d-idioms anyway.
>>>>>
>>>>
>>>> http://p0nce.github.io/d-idioms/#How-does-D-improve-on-C++17?
>>>
>>> excellent.
>>>
>>> I linked it here: http://wiki.dlang.org/Coming_From
>>
>> Luke 4:24 "nobody is prophet in his own country"
>>
>> http://www.reddit.com/r/programming/comments/33x6lj/how_does_d_improve_on_c17/
>
> Lesson taken: should have put a less aggressive title.

Not necessarily.  The people who complain loudly constitute a tiny subset of those who are ultimately influenced.  One can't walk through life in fear of criticism, and if you believe D is superior in this respect and backed it up (which it seemed to me you did), then I think it's more effective to say so and prepare for the inevitable brickbats than to placate those who will always find a reason to attack you ;)

In any case, some really good stuff in your idioms.  Maybe worth turning into a longer blog piece that recounts in a personal voice your experience of using D as a C++ guy.
April 27, 2015
On Monday, 27 April 2015 at 07:45:30 UTC, Laeeth Isharc wrote:
> On Sunday, 26 April 2015 at 19:13:33 UTC, ponce wrote:
>>
>> Lesson taken: should have put a less aggressive title.
>
> Not necessarily.  The people who complain loudly constitute a tiny subset of those who are ultimately influenced.  One can't walk through life in fear of criticism, and if you believe D is superior in this respect and backed it up (which it seemed to me you did), then I think it's more effective to say so and prepare for the inevitable brickbats than to placate those who will always find a reason to attack you ;)
>

Good advice, thanks! It seems the more assertive tones often get less criticism.

> In any case, some really good stuff in your idioms.  Maybe worth turning into a longer blog piece that recounts in a personal voice your experience of using D as a C++ guy.

Thanks. There might be errors in places.

Bringing D in the workplace often bring incredible resistance and arguments.

I've heard it all over the years:
- "D is like C#, why use it?"
- "D can't be scripted" (yes it can)
- "D isn't fast enough"
- "D isn't much used and is 10 years old, there must be problems"
- "D isn't used enough"

Much like C++ was met with resistance?
Meanwhile D programs get written and consistently over-deliver on promises.
April 27, 2015
On Mon, 27 Apr 2015 08:23:26 +0000, ponce wrote:

> Bringing D in the workplace often bring incredible resistance and arguments.
> 
> I've heard it all over the years:
> - "D is like C#, why use it?"
> - "D can't be scripted" (yes it can)
> - "D isn't fast enough"
> - "D isn't much used and is 10 years old, there must be problems"
> - "D isn't used enough"
> 
> Much like C++ was met with resistance?
> Meanwhile D programs get written and consistently over-deliver on
> promises.

D has one thing that kills C++ instantly, though: modules (and declaration order). anyone who had a joy to work on big project with C or C++ will sell his soul for module system.

1 2 3 4 5
Next ›   Last »