92 points by jandeboevrie 21 hours ago | 84 comments
mcdeltat 16 hours ago
dahart 9 hours ago
When I was in college in the 90s, templates were new and had iffy support. In the 2000s, STL was still problematic. I remember the Microsoft Compiler spitting out error messages on STL types that were so long the compiler couldn’t handle the string length and truncated the error message so you couldn’t see what the problem was. In the late 00s and early 10s I worked in games, we wanted stability and for the code to be as non-tricky as possible (for example by banning use of exceptions, STL containers, and most casual heap allocation, among other things.) So we used older compilers by choice. My current job publishes an SDK and APIs that people have been using for many years, they need to be backward compatible and we can’t impose recent language features on our users because not everyone uses them, we have to stick to features that compile everywhere, so I still see lots of C++{11,14,17}.
OneDeuxTriSeiGo 13 hours ago
pjmlp 9 hours ago
The problem is that with the new wind C++ got with C++11, its role in GCC and LLVM, and domains like HPC, HFT, GPGPU, WG21 got up to 300 something members, everyone wanting to leave their name on a C++ standard, many proposing features in PDF form only.
And since in ISO driven languages, what gets into a standard, does so by votes, not technical implementation merit, it is about doing a proper campaign to get the bases to vote for your feature, while being persistent enough to keep the process going. Some features have more than 20 revisions on their proposal.
einpoklum 5 hours ago
I'm not saying that the existing situation is ideal and it's certainly not a dichotomy, but you have to consider the detriments as well as the benefits.
pjmlp 4 minutes ago
Also I should add this is no different on wannabe C and C++ replacements, or most other programming languages with similar market share.
Go try to do a drive by pull request for a new language feature on those ecosystems.
Measter 3 hours ago
Then you have Stage 2, which would require an actual working implementation, so it can be properly tested and such. Acceptance in Stage 2 would result in the feature being in the standard.
Pet_Ant 15 hours ago
veilrap 18 hours ago
I'm actually looking forward to the related reflection features that I think are currently in scope for C++26. I've run into a number of places where the combination of reflection and constexpr could be really valuable... the current workarounds often involving macros, runtime tricks, or both.
steveklabnik 18 hours ago
The core of reflection should be in C++26, yes. In my understanding, there's more to do after that as well. We'll see when the final meeting is done.
Quitschquat 20 hours ago
MrRadar 18 hours ago
TOGoS 16 hours ago
The only reason I didn't write more stuff in D was that the stack traces from my programs were pretty much useless. Maybe I was supposed to set a --better-stack-traces flag when I compiled it or something idk.
[1] One of the algorithms used by https://github.com/TOGoS/PicGrid
sfpotter 12 hours ago
lenkite 11 hours ago
gavinray 4 hours ago
That being said, I can't think of many scenarios in which an application where user-code is all `@nogc` would be hindered by occasional GC'ed stdlib methods.
One standout example of viability is the "dplug" library for realtime audio processing plugins and the commercial AuburnSounds VST's written by the author.
neonsunset 7 hours ago
That's one of the craziest things I've heard here. These two languages sit at opposite ends of abstraction.
AdieuToLogic 15 hours ago
Scala gets pretty close to LISP-level of metaprogramming support between its intrinsic support for macros[0] (not to be confused with the C/C++ preprocessor of the same name), the Scalameta project[1], and libraries such as Shapeless[2].
Not comparing Scala to D, just identifying a language with similar functionality.
0 - https://docs.scala-lang.org/scala3/reference/metaprogramming...
kazinator 20 hours ago
gpderetta 18 hours ago
klipt 19 hours ago
dataflow 18 hours ago
yuppiemephisto 17 hours ago
Gives what you wished for. It's functional, though (among other things). Unlike most lisps, (dependently) typed. But hey, available at compile-time.
112233 11 hours ago
Half of new features feel like "how to make STL implementation less embarassing".
Meanwhile there still is no language support for e.g. debugging constexpr, or printing internal private state of objects in 3rd party code.
HelloNurse 8 hours ago
gpderetta 7 hours ago
At no point were lambdas single return statement. You might be confusing it with some other language feature. Or language.
pjmlp 9 hours ago
That is more a dynamic monkey patching programming language kind of thing.
greesil 11 hours ago