Remix.run Logo
motorest 4 days ago

> Digital Mars C++ has had contracts since, oh, the early 1990s?

I think that implementations trying out their own experimental features is normal and expected. Ideally, standards would be pull-based instead of push-based.

The real question is what prevented this feature from being proposed to the standardization committee.

arunc 4 days ago | parent [-]

It was proposed by Walter and denied by Stroustroup, probably to save C++. Karma hits back and he is trying to save C++ from Rust.

WalterBright 4 days ago | parent | next [-]

D is the result of lack of interest by the C++ committee, and I had little interest in spending literally years trying to get useful things adopted into C++.

Ironically, over the years, C++ has adopted many features popularized by D.

(like contracts!)

C++ should adopt a few more D features, like https://www.digitalmars.com/articles/C-biggest-mistake.html, compile time expression evaluation (C++ did it wrong), forward references, and modules that work. C++ should also deprecate the preprocessor, a stone-age kludge that has long been obsolete.

motorest 3 days ago | parent [-]

> D is the result of lack of interest by the C++ committee, and I had little interest in spending literally years trying to get useful things adopted into C++.

I think you are leaving out the fact that your comment applies to the post-C++98/pre-C++11 hiatus.

Once C++11 was released, the truth of the matter is that whatever steam D managed to build up, it fizzed out.

I'm also not sure if it's accurate to frame the problem with C++0x as picking up features from D. As I recall, D's selling point was that it was scrambling to provide the features covered by C++0x but users weren't forced to wait for a standard to be published to be able to use them. Once they could, there was no longer any compelling reason to bother with D anymore.

WalterBright 3 days ago | parent [-]

C++ is still trying to catch up with:

- compile time function execution

- modules

- no preprocessor

- memory safe arrays

- preprocessor replacement

- ranges

and so on.

motorest 3 days ago | parent | next [-]

> C++ is still trying to catch up with (...)

C++ modules are indeed a mess, but you are fooling yourself if you believe that the preprocessor of all things is a compelling reason to switch. In fact, I think you unwittingly proved my point on how interest in D fizzed out the moment C++11 was released.

WalterBright 2 days ago | parent [-]

> if you believe that the preprocessor of all things is a compelling reason to switch

The preprocessor is an unhygienic, ugly mess. Just look at the system .h files, which should be a showcase on how to use it correctly. I stand by my assessment of it.

72deluxe 3 days ago | parent | prev [-]

As I am oblivious to D, may I ask if there are suitable GUI toolkits for it, or bindings? I typically use wxWidgets in C++ land.

WalterBright 2 days ago | parent [-]

https://wiki.dlang.org/GUI_Libraries

wxD is the wxWidgets library.

pjmlp 4 days ago | parent | prev | next [-]

People keep forgetting C++ design is driven by 300+ people, and the features that get into the language go to elections, that they have to win.

Stroustoup has one vote, not everything he advocates for wins votes, including having a saner C++ (Remember the Vasa paper).

motorest 4 days ago | parent | prev [-]

> It was proposed by Walter and denied by Stroustroup, probably to save C++.

Citation needed.

For starters, where is the paper?

shakna 4 days ago | parent [-]

Well, there's this list Stroustrup offers, of systems in C++ that he would reject: [0]

[0] https://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p0977r0...

pjmlp 4 days ago | parent [-]

One vote, C++ isn't a BDFL driven language.

Also WG14 famously killed Dennis Ritchie proposal to add fat pointers to C.

Language authors only have symbolic value once they relish control to a standards body.