April 23, 2017
On 4/23/2017 5:04 AM, Guillaume Piolat wrote:
> The rules of leak-free, exception-safe C++11 aren't so hard.
> - single-owneship for everything, invent fake owner if needed
> - std::unique_ptr for owning pointer, raw pointers for borrowed
>   (unique_ptr neatly avoids to write a RAII wrapper for everything)
>
> When teams internalize these rules, no more leaks, no more double-free, etc.
> Hence Rust that sanctified this style.

The trouble is, one cannot look at a piece of code and tell if it follows the rules or not.

I.e. it's not about it being possible to write memory safe code in C or C++ (it is), it's about verifying an arbitrary piece of code as being memory safe.
April 24, 2017
On Monday, 24 April 2017 at 06:37:40 UTC, Walter Bright wrote:
> The trouble is, one cannot look at a piece of code and tell if it follows the rules or not.
>
> I.e. it's not about it being possible to write memory safe code in C or C++ (it is), it's about verifying an arbitrary piece of code as being memory safe.

I don't think D and Rust fare any better than modern C++ as far as ARBITRARY code goes. Swift and Java does...
April 24, 2017
On 24.04.2017 13:33, Ola Fosheim Grøstad wrote:
> On Monday, 24 April 2017 at 06:37:40 UTC, Walter Bright wrote:
>> The trouble is, one cannot look at a piece of code and tell if it
>> follows the rules or not.
>>
>> I.e. it's not about it being possible to write memory safe code in C
>> or C++ (it is), it's about verifying an arbitrary piece of code as
>> being memory safe.
>
> I don't think D and Rust fare any better than modern C++ as far as
> ARBITRARY code goes. Swift and Java does...

Swift allows raw pointer manipulation. Java implementations expose similar unsafe features. JVMs have bugs. Also, Java's type system is unsound.

April 24, 2017
On Monday, 24 April 2017 at 15:17:18 UTC, Timon Gehr wrote:
> Swift allows raw pointer manipulation.

I didn't know that Swift had that as a language construct. Link? I know that it provides library solutions for raw pointers, but that can be said for most languages.

> Java implementations expose similar unsafe features.

You think so?



April 24, 2017
On 04/24/2017 11:17 AM, Timon Gehr wrote:
> Also, Java's type system is
> unsound.
>

Not doubting you, but this sounds interesting. Further info or links?
April 24, 2017
On 24.04.2017 19:02, Nick Sabalausky (Abscissa) wrote:
> On 04/24/2017 11:17 AM, Timon Gehr wrote:
>> Also, Java's type system is
>> unsound.
>>
>
> Not doubting you, but this sounds interesting. Further info or links?

https://dev.to/rosstate/java-is-unsound-the-industry-perspective
April 25, 2017
On Sunday, 23 April 2017 at 12:29:24 UTC, Guillaume Piolat wrote:
> On Sunday, 23 April 2017 at 12:04:08 UTC, Guillaume Piolat wrote:
>> Hence Rust that sanctified this style.
>
> And why it's not that interesting to the modern C++ programmer.

Actually, writing Rust made me realise how bad my C++ code actually is. Even with unique_ptr et al.

Atila
April 25, 2017
On Tuesday, 11 April 2017 at 06:08:16 UTC, Ali Çehreli wrote:
>
> I have to say it took me a very long time to come up with the title and the abstract. How could I sell D to C++ experts? Luckily, I asked Manu and among a long list of ideas he said "it's about saving time" and "time is money". How can you argue with that? ;)

I do agree, but C++ people may be less open to buy the whole package at once... The other speakers (Rust, Haskell) will talk about specific things that they regard as nicer in their languages compared to C++ (safe memory access, concurrency in Rust; side effect safety in Haskell). C++ users can more easily agree to these individual points and later become interested in the other languages.

It's true that D's paradigm is less different from C++ and it's more about being better designed and safer as a whole. It's like, sure you can write 80% of D programs in C++ with only twice the typing at most, as long as your compiler supports C++14 at least, and you're super careful with memory... but you'll still be driven insane by the remaining 20% ;)
April 28, 2017
On Tuesday, 25 April 2017 at 13:57:53 UTC, XavierAP wrote:
> On Tuesday, 11 April 2017 at 06:08:16 UTC, Ali Çehreli wrote:
>>
>> I have to say it took me a very long time to come up with the title and the abstract. How could I sell D to C++ experts? Luckily, I asked Manu and among a long list of ideas he said "it's about saving time" and "time is money". How can you argue with that? ;)
>
> I do agree, but C++ people may be less open to buy the whole package at once... The other speakers (Rust, Haskell) will talk about specific things that they regard as nicer in their languages compared to C++ (safe memory access,

@safe

> concurrency in Rust;

std.concurrency

Funny story: the first ever (and really, only) program I wrote in Rust had a deadlock in it. I never did figure out why, I just stopped using threads to get rid of the problem. I know it's only anecdata, but "fearless concurrency" does not gel with my experience.

I don't even remember the last time I wrote a deadlock in C++, if ever. Not once in D, that's for sure. It's hard to deadlock when you hardly ever lock. :)

I have fearless concurrency now, in D. Message passing FTW.

> side effect safety in Haskell).

pure

> C++ users can more easily  agree to these individual points and later become interested in the other languages.

Well, let's show them the same points then ;)

>
> It's true that D's paradigm is less different from C++ and it's more about being better designed and safer as a whole. It's like, sure you can write 80% of D programs in C++ with only twice the typing at most,

In my experience, _at least_ twice the typing, and 3 times as many bugs. And I'm talking about C++14 here. The other day I was reminded that in C++ land one has to manually write `operator<<` to print things out and `operator==` to compare things.

Atila
April 28, 2017
On 04/28/2017 04:26 PM, Atila Neves wrote:
> The other day I was reminded that in
> C++ land one has to manually write `operator<<` to print things out and
> `operator==` to compare things.

What, seriously?!?

That's the thing about C++: The right way is the obscure way, and the straightforward way is the wrong way. And yesterday's right way is today's wrong way. And apparently (it would seem), the only way NOT to completely fuck *everything* up is to become an expert on every corner of the language, and STAY an expert on all the latest changes. In the immortal words (and voice) of Duke Nukem: "What a mess!"

Seriously, I don't care about the political incorrectness of bashing or comparing to other languages, this right here is and always was D's killer feature, the whole reason I got into it in the first place and have stayed: D takes all the current (and former!) application domains of C/C++, and brings to it basic programmer sanity. 'Nuff said.