11 ms·
C++26 is done: ISO C++ standards meeting Trip Report
- VerifiedReports 8mo agoAs long as programmers still have to deal with header files, all of this is lipstick on a pig.
- jjmarr 8mo agoYou don't on new projects. CMake + ninja has support for modules on gcc, clang, and MSVC. This should be your default stack on any small-to-medium sized C++ project. Bazel, the default pick for very large codebases, also has support for C++20 modules.
- VerifiedReports 8mo agoThanks. It's been a long time since I started a C++ project, and I've never set up any build chain in Visual Studio or Xcode other than the default.
- sgt 8mo agoHow about using Zig to build C++ projects?
- jjmarr 8mo agoI haven't used it. That being said, while it looks better than CMake, for anything professional I need remote execution support to deviate from the industry standard. Zig doesn't have that. This is because large C++ projects reach a point where they cannot be compiled locally if they use the full language. e.g. Multi-hour Chromium builds.
- sgt 8mo agoSurely Zig can also be invoked using any CI/CD flow running on a remote machine too.
- jjmarr 8mo agoI'm referring to this: https://github.com/bazelbuild/remote-apis https://github.com/bazelbuild/remote-apis Once you get a very large C++ project with several thousand compilation jobs over hundreds of devs, you need to distribute the build across multiple computers and have a shared cache for object files. Zig doesn't seem to support that.
- duped 8mo agoI have yet to see modules in the wild. What I have seen extensively are header-only projects.
- jjmarr 8mo agoYou're not supposed to distribute the precompiled module file. You are supposed to distribute the source code of the module. Header-only projects are the best to convert to modules because you can put the implementation of a module in a "private module fragment" in that same file and make it invisible to users. That prevents the compile-time bloat many header-only dependencies add. It also avoids distributing a `.cpp` file that has to be compiled and linked separately, which is why so many projects are header-only.
- FrostKiwi 8mo agoIt's the fault of built systems. CMake still doesn't support `import std` officially and undocumented things are done in the ecosystem [1] But once it works and you setup the new stuff, having started a new CPP26 Project with modules now, it's kinda awesome. I'm certainly never going back. The big compilers are also retroactively adding `import std` to CPP20, so support is widening. [1] https://gitlab.kitware.com/cmake/cmake/-/work_items/27706 https://gitlab.kitware.com/cmake/cmake/-/work_items/27706
- duped 8mo agoweird to blame build systems for a problem caused by the language
- deleted 8mo ago[deleted]
- 72deluxe 8mo agoI don't understand this at all. There are modules. But headers are perfectly fine to deal with and have been for decades and decades! Next you'll be arguing that contents pages in all books should be removed.
- VerifiedReports 8mo agoWhat an absurd attitude. The gymnastics to avoid circular inclusions alone are something nobody should be giving a thought to in the 2000s. "But headers are perfectly fine to deal with and have been for decades and decades!" I would have thought this was a joke... but your follow-up indicates otherwise. So what are you going to float next? "So what if people broke their arms hand-cranking their cars to start them! People did it for years, so we shouldn't move to electric starters! Or automatic chokes!" "And these electric ice boxes are for the birds! Speaking of which: People flying through the air in machines? POPPYCOCK!"
- 72deluxe 8mo agoI honestly don't understand. Circular inclusions are something to deal with, but it's a tree.... so how can a leaf contain a branch?? I know C# does some magical things (I know not what) to avoid this since there are no headers so you can refer to something in the same assembly/namespace thingy, but it's very different to how C++ compiles and links? I wasn't saying that progress should be stinted, but that complaining about something with the expectation that it magically be solved is a strange view of the world. Do you also just assert that poverty and war shouldn't exist?
- pjmlp 8mo agoI use modules in all my private projects since the last two years.
- mohamedkoubaa 8mo agoBiggest open question is whether the small changes to the module system in this standard will actually lead to more widespread adoption
- forrestthewoods 8mo agoNo. Modules are a failed idea. Really really hard for me to see them becoming mainstream at this point.
- hrmtst93837 8mo ago[flagged]
- m-schuetz 8mo agoThe idea is great, the execution is terrible. In JS, modules were instantly popular because they were easy to use, added a lot of benefit, and support in browsers and the ecoysystem was fairly good after a couple of years. In C++, support is still bad, 6 years after they were introduced.
- evanmoran 8mo agoExactly. C++ is still waiting for its "uv" moment, so until then modules aren't even close to solved.
- lostdog 8mo agoAnd uv required some ground work, where the PEP process streamlined how you define a python project, and then uv could be built on top.
- creato 8mo agoThe idea is great in the same way the idea of a perpetual motion machine is great: I'd love to have a perpetual motion machine (or C++ modules), but it's just not realistic. IMO, the modules standard should have aimed to only support headers with no inline code (including no templates). That would be a severe limitation, but at least maybe it might have solved the problem posed by protobuf soup (AFAIK the original motivation for modules) and had a chance of being a real thing.
- LatencyKills 8mo agoThis is awesome. I've was a dev on the C++ team at MS in the 90s and was sure that RTTI was the closest the language would ever get to having a true reflection system.
- rustyhancock 8mo agoI look forwards to getting to make use of this in 2040! Proper reflection is exciting.
- bigbuppo 8mo agoGCC has it marked as 'RESOLVED FIXED' as of about a week and a half ago. So, it's coming. Also, useful: https://gcc.gnu.org/projects/cxx-status.html https://gcc.gnu.org/projects/cxx-status.html
- rustyhancock 8mo agoSupport in GCC isn't what limits my usage of latest C++ at work.
- bigbuppo 8mo agoClang also isn't too far off of GCC on support, so if you're not using either of those, my condolences. And if it's management mandate, god help us all.
- affenape 8mo agoFinally, reflection has arrived, five years after I last touched a line in c++. I wonder how long would it take the committee, if ever, to introduce destructing move.
- IshKebab 8mo agoYeah I feel the same way. Lots of nice features that would have been helpful 5 years ago before I switched to Rust.
- 72deluxe 8mo agoWhat do you mean by a destructing move? Are you trying to avoid use of a moved object after you've moved it? eg. B = std::move(A); // You are worried about touching A when it's in this indeterminate state?
- yolina 8mo agodestructive moves are required to make moves zero cost. Currently move semantics in C++ requires that A is left in a 'moved from, but valid state' which means that: 1. The compiler must still generate code that calls the destructor. 2. Every destructor need have to have some flag and a test in it like: if(moved_from) // do nothing else { free_resources(); } (Granted, for some simple types the compiler might inline and removed redundant checks so it ends up with no extra code, but that is not guaranteed) With destructive moves the compiler can just forget about the object completely, no need to call it, destructurs can be written as normal and only care about the invariants established in the constructor.
- 72deluxe 8mo agoSo how would you ensure you can't do this? A = 0; B = 0; A = move(B); ++B; ++A; What should happen at ++B, and what should A be at the end? How would the compiler enforce this? I can see this being complicated. The compiler can forget about it, but the code doesn't, so you mismatch between what is on screen and what the compiler does, which seems even more confusing.
- levodelellis 8mo agoGreat. C++20 has been my favorite and I was wasn't sure what the standards says since it's been a while. I'll be reading the C++26 standard soon
- suby 8mo agoI am somewhat dismayed that contracts were accepted. It feels like piling on ever more complexity to a language which has already surpassed its complexity budget, and given that the feature comes with its own set of footguns I'm not sure that it is justified. Here's a quote from Bjarne, > So go back about one year, and we could vote about it before it got into the standard, and some of us voted no. Now we have a much harder problem. This is part of the standard proposal. Do we vote against the standard because there is a feature we think is bad? Because I think this one is bad. And that is a much harder problem. People vote yes because they think: "Oh we are getting a lot of good things out of this.", and they are right. We are also getting a lot of complexity and a lot of bad things. And this proposal, in my opinion is bloated committee design and also incomplete.
- addaon 8mo agoI can’t speak to the C++ contract design — it’s possible bad choices were made. But contracts in general are absolutely exactly what C++ needs for the next step of its evolution. Programming languages used for correct-by-design software (Ada, C++, Rust) need to enable deep integration with proof assistants to allow showing arbitrary properties statically instead of via testing, and contracts are /the/ key part of that — see e.g. Ada Spark.
- StilesCrisis 8mo agoRight, I think the tension here is that we would like contracts to exist in the language, but the current design isn't what it needs to be, and once it's standardized, it's extremely hard to fix.
- bluGill 8mo agoThe people who did contracts are aware of ada/spark and some have experience using it. Only time will tell if it works in c++ but they at least did all they could to give it a chance. Note that this is not the end of contrats. This is a minimun viable start that they intend to add to but the missing parts are more complex.
- 8mo ago
- mococa 8mo agoSadly, transparent hash strings for unordered_map are out.
- secondcoming 8mo agoIt is annoying that they didn't just apply this to all containers
- porise 8mo agoI don't care until they stop pretending Unicode doesn't exist.
- usrnm 8mo agoWhat are you talking about, there is actually too much unicode awareness in C++. Unicode is not the same thing as utf-8. And, frankly, no language does it right, I'm not even sure "right" exists with Unicode
- leni536 8mo agoToo much unicode in standard C++? Where?
- Blackthorn 8mo agoc++20's u8strings took a giant steaming dump on a number of existing projects, to the point that compiler flags had to be introduced to disable the feature just so c++20 would work with existing codebases. Granted that's utf-8 (not the same thing as unicode, as mentioned) but it's there.
- leni536 8mo agoAnd yet, unicode support is still abysmal throughout the standard library. I don't disagree though.
- kccqzy 8mo agoThings like char32_t, std::u32string for storing UTF-32 characters.
- porise 8mo agoAnd yet, none of them work with std::regex etc.
- the__alchemist 8mo ago[flagged]
- throwawaypath 8mo agoPlease don't use Hacker News as a religious or ideological battleground. It tramples curiosity. Please don't pick the most religiously/ideologically provocative thing in an article or post to complain about in the thread. Find something interesting to respond to instead.
- the__alchemist 8mo agoThis is interesting! People ignoring this, I think, is also interesting on its own. I respect if other people disagree, but that's my 2c. I think our overton windows may not agree here, but I think this is part of the value of discussions with other humans. Are you a moderator? The directive tone of this post is as if from an authority figure, but, but I do not believe you are one. I do not believe there is anything about a religious or ideological background here. Could you please clarify? I also believe it is your post that could be more accurately described as trampling curiosity; I believe there is a role reversal, in that I think your comment is a better description for trampling curiosity than the post your are responding. I'm not trying to be snarky - I'm curious how you came to those conclusions.
- kzrdude 8mo agoThe tone of the GP is such because it's a quote from the rules/guidelines. However, applying that rule to what you said makes no sense to me, fwiw.
- throwawaypath 8mo ago>This is interesting! No it's not. After a decade of the US-centric coastal leftist obsession with race and gender it is not interesting. It's about as interesting as Christians commenting on abortion. >Are you a moderator? The directive tone of this post is as if from an authority figure, but, but I do not believe you are one. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html >I do not believe there is anything about a religious or ideological background here. Could you please clarify? US leftist's obsession with race and gender is religious/ideological. >I also believe it is your post that could be more accurately described as trampling curiosity; I believe there is a role reversal, in that I think your comment is a better description for trampling curiosity than the post your are responding. This is what every religious/ideological zealot says when they're denied a platform to spew their nonsense. Please review the guidelines linked above.
- dataflow 8mo ago> Second, conforming compiler and standard library implementations are coming quickly. Throughout the development of C++26, at any given point both GCC and Clang had already implemented two-thirds of C++26 features. Today, GCC already has reflection and contracts merged in trunk, awaiting release. How far is Clang on reflection and contracts?
- cpeterso 8mo agoClang’s C++2c implementation status page simply says “no” for both reflection and contracts. GCC’s says “yes”. https://clang.llvm.org/cxx_status.html https://clang.llvm.org/cxx_status.html https://gcc.gnu.org/projects/cxx-status.html https://gcc.gnu.org/projects/cxx-status.html
- dataflow 8mo agoThat much I'm aware, but that's just about feature availability. I was wondering how far the implementations have progressed internally, despite the features being unavailable.
- tbaeder 8mo agoClang basically doesn't implement anything regarding reflection right now. There is some support for parsing (https://github.com/llvm/llvm-project/blob/main/clang/test/Parser/parsing-reflection.cpp https://github.com/llvm/llvm-project/blob/main/clang/test/Pa...) but that's it. There are some open PRs for other parts though.
- dataflow 8mo agoThanks, yeah, I was worried that might be the case. Given how complicated these features sound, it makes me wonder if they're gonna finish before the decade is over...
- Asmod4n 8mo agoBloomberg has a clang implementation of reflection: https://github.com/bloomberg/clang-p2996 https://github.com/bloomberg/clang-p2996 It has been on compiler explorer for a while This has been used to add reflection to simdjson
- AyanamiKaine 8mo agoI am actually excited for post and pre conditions. I think they are an underused feature in most languages.
- augustk 8mo agoPostconditions are in conflict with programmers' love of early returns.
- HelloNurse 8mo agoFormally, it doesn't appear to be so (tests can be added to each early return); in practice, encouraging the reorganization of messy early returns would be zero cost developer reeducation.
- jcalvinowens 8mo agoThe "erroneous behavior" redefinition for reads of uninitialized variables is really interesting: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2795r5.html https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p27... It does have a runtime cost. There's an attribute to force undefined behavior on read again and avoid the cost: int x [[indeterminate]]; std::cin >> x;
- augusto-moura 8mo agoHm, I wonder if this will be a compiler flag too, probably yes, since some projects would prefer to init all variables by hand anyway.
- WalterBright 8mo agoD initializes all variables. If you don't provide an initializer, the compiler inserts the default initializer for it. But if you really, really want to leave it uninitialized, write: int x = void; where you're not writing that by accident.
- Negitivefrags 8mo agoThat is a way better syntax. I wonder why C++ didn't adopt it.
- jcalvinowens 8mo agoThere's a whole section on that: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2795r5.html#optout-alts https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p27...
- WalterBright 8mo agoI don't understand its claim of a "self-documentation trap". I'm surprised the "= void;" wasn't discussed. People liked it immediately in D, and other alternatives were not proposed.
- ill_ion 8mo agoContracts feel like the right direction but the wrong execution timeline. The Ada/SPARK model shows how powerful contracts become when they feed into static verification — but that took decades of iteration on a language with far cleaner semantics. Bolting that onto C++ where UB is load-bearing infrastructure is a different beast entirely. The real risk isn't complexity for complexity's sake — it's that a "minimum viable" contracts spec gets locked in, and then the things that would actually make it useful for proof assistants become impossible to retrofit because they'd break the v1 semantics. Bjarne's concern about "incomplete" is more worrying to me than "bloated."
- sgt 8mo agoNice try, clanker slop
- chrisaycock 8mo agostd::execution is very interesting, but will be difficult to get started with, as cautioned by Sutter. This HPC Wire article demonstrates how to use standard C++ to benefit from asynchronously parallel computation on both CUDA and MPI: https://www.hpcwire.com/2022/12/05/new-c-sender-library-enables-portable-asynchrony/ https://www.hpcwire.com/2022/12/05/new-c-sender-library-enab... Overlapping communication and computation has been a common technique for decades in high-performance computing to "hide latency", which leads to better scaling. Now standard C++ can be used to express parallel algorithms without tying to a specific scheduler.
- pjmlp 8mo agoNVidia is the main sponsor of this kind of work, and a few key figures are nowadays on their payroll.
- FpUser 8mo agoI am curious what is their strategy to get language to the stage where the US government will make it cosher for new projects
- jandrewrogers 8mo agoNo such strategy is necessary. That discourse was about not using C++ for applications where Java would work just as well. The US government still uses C++ widely for new projects. For some types of applications it is actually the language of choice and will remain so for the foreseeable future.
- FpUser 8mo ago>"For some types of applications it is actually the language of choice..." Can you give an example please? And how does it correspond to government ONCD report and other government docs "recommending" "safe" languages like: Rust (noted for its ability to prevent memory-unsafe code), Go, Java, Swift, C#, Ruby, Ada Among other things I design and implement high performance C++ backends. for some I got SOCS2 Type II certification but I am curious about future. Do not give a flying fuck about what the criteria for military projects as I would not ever touch one even if given a chance.
- jandrewrogers 8mo agoIt is the high-performance/high-scale data processing and storage engines for data-intensive applications, some of which are used in high-assurance environments. These are used outside of defense/intel (the data models are generic) but defense/intel tends to set the development standards for government since theirs are the strictest and most rigorous. An increasingly common requirement is the ability to robustly reject adversarial workloads in addition to being statically correct. Combined with the high-performance/high-scale efficiency requirements, this dictates what the software architecture can look like. There are a few practical reasons Rust is not currently considered an ideal fit for this type of development. The required architecture largely disables Rust's memory-safety advantages. Modern C++ has significantly better features and capabilities under these constraints, yielding a smaller, more maintainable code base. People worry about supply chain attacks but I don't think that is a major factor here. Less obvious, C++ has strong compile-time metaprogramming and execution features that can be used to extensively automate verification of code properties with minimal effort. This allows you to trivially verify many correctness properties of the code that Rust cannot. It ends up being a comparison of unsafe Rust versus verification maximalist C++20, which tilts the safety/reliability aspects pretty hard toward C++. Code designed to this standard of reliability has extremely low defect rates regardless of language but it is much easier in some languages than others. I even shipped Python once. A lot of casual C++ code doesn't bother with this level of verification, though they really should. It has been possible for years now. More casual applications also have more exposure to memory safety issues but those mostly use Java in my experience, at least in government.
- Tenobrus 8mo ago"Japanese soldier who kept fighting 29 years after World War 2"
- cedws 8mo agoI watched a talk from Bjarne Stroustrup at CppCon about safety and it was pretty second hand embarrassing watching him try to pretend C++ has always been safe and safety mattered all along to them before Rust came along.
- einpoklum 8mo agoWell, there has been a long campaign against manual memory management - well before Rust was a thing. And along with that, a push for less use of raw pointers, less index loops etc. - all measures which, when adopted, reduce memory safety hazards significantly. Following the Core Guideliness also helps, as does using span's. Compiler warnings has improved, as has static analysis, also in a long process preceding Rust. Of course, this is not completely guaranteed safety - but safety has certainly mattered.
- cedws 8mo ago>Following the Core Guideliness also helps Yes, this what Stroustrup said and it makes me laugh. IIRC he phrased with a more of a 'we had safety before Rust' attitude. It also misses the point, safety shouldn't be opt-in or require memorising a rulebook. If safety is that easy in C++ why is everyone still sticking their hand in the shredder?
- einpoklum 8mo agoYou're "moving the goal posts" of this thread. Safety has mattered - in C++ and in other languages as well, e.g. with MISRA C. As for the Core Guidelines - most of them are not about safety; and - they are not to be memorized, but a resource to consult when relevant, and something to base static analysis on.
- einpoklum 8mo agoIf you ask me (and why wouldn't you? :-)...) I really wish the C++ WG would do several things: 1. Standardize a `restrict` keyword and semantics for it (tricky for struct/class fields, but should be done). 2. Uniform Function Call Syntax! That is, make the syntax `obj.f(arg)` mean simply `f(obj, arg)` . That would make my life much easier, both as a user of classes and as their author. In my library authoring work particularly. And while we're at it, let us us a class' name as a namespace for static methods, so that Obj::f the static method is simply the method f in namespace Obj. 3. Get compiler makers to have an ABI break, so that we can do things like passing wrapped values in registers rather than going through memory. See: https://stackoverflow.com/q/58339165/1593077 https://stackoverflow.com/q/58339165/1593077 4. Get rid of the current allocators in the standard library, which are type-specific (ridiculous) and return pointers rather than regions of memory. And speaking of memory regions (i.e. with address and size but no element type) - that should be standardized too.
- tourist2d 8mo ago1. This seems like it's be far too tricky and make C++ even more footgunny, especially with references, move constructors, etc etc. 2. Name lookup and overload resolution is already so complex though! This will likely never be added because it's so core c++ and would break so much. imo, it also blurs the line between what's your interface vs what I've defined. 3. This is every junior c++ engineers suggestion. Having ABI breaks would probably kill c++, even though it would improve the language long term. 4. Again, you make solid points and I think a lot of the committee would agree with you. However, the committee's job is to adapt C++ in a backwards supporting way, not to disrupt it's users and API each new release. There are definitely things to fix in c++ and every graduate engineer I've managed has had the same opinions of patching the standard, without considering the full picture.
- einpoklum 8mo agoRe (1.): Not-having-footguns is not a basic design principle of C++. But principles which it is supposed to adhere to include: * Don't pay for what you don't use; * Not leaving for another language between C++ and assembly (or to phrase it differently: "when you use an abstraction mechanism appropriately, you get at least as good performance as if you had hand-coded using lower-level constructs") and the lack of `restrict` breaks both of these, significantly. Because compilers are forced to implement even simple functions with repeated re-reading of data - due to the possibility of aliasing - which the software developer knows is entirely unnecessary, and would have avoided had he been writing the same function in, say, C (and of course compiler IR or assembly) Re (2): It's not really "core C++": It would not make any existing program non-well-formed, nor change its semantics, at all. But it's true that this would have an impact on how we design classes - and that's the exact intent. And it does far more than "blur the line between what's your interface vs what I've defined" - it deletes most of this line, ,and that is exactly the point. The line we should have is the line of acccess restriction: Does a method have access to the class' private data, or doesn't it. If it doesn't, then, there are simply functions which take an oject of the class; and it doesn't matter if the class author defined them or if someone else defined them. Re (3.): I didn't say lack of backwards compatibility, just that going forwards, ABIs would allow some things which are currently prevented [1]. I am not an ABI expert in the least, but IIUC, use of new ABI can be marked, so that nothing gets mixed up. I would also claim that ABI stability should cede to the design principles I mentioned above. [1]: https://cor3ntin.github.io/posts/abi/ https://cor3ntin.github.io/posts/abi/
- rr808 8mo agoI switched from C++ to Java/Python 20 years ago. I never really fit in, I just dont understand when people talk about the complicated frameworks to avoid multithreading/mutexes etc when basic C++ multi threading is much simpler than rxjava or async/await or whatever is flavor of the month. But C++ projects are usually really boring. I want to go back but glad I left. Has anyone found a place where C++ style programming is in fashion but isn't quite C++? I hope that makes sense.
- xonre 8mo agoThat place is C++/Lua, with most of the code in Lua. Concurrency model is thread-per-lua-state. Interthread comms is message passing implemented via textbook c++11 atomic and condition variables. Lua is just a small C library so the style remains very friendly to those who like C with classes.
- ozgrakkurt 8mo agoIt looks like they didn't even add _BitInt types yet. Adding concepts but not adding _BitInt types sounds insane considering how simple _BitInt types are as a programmer (not sure about implementation but it already works in clang).
- jandrewrogers 8mo ago_BitInt types probably aren’t a priority because they are more or less trivial to implement yourself in C++. Also, some of the implementation details and semantics do matter in an application dependent way, which makes it a bit of an opinionated feature. I would guess there is a lot of arguing over the set of tradeoffs suitable for a standard, since C++ tends to avoid opinionated designs if it can.
- pjmlp 8mo agoJust like restrict never made it. Someone has to write a proposal, bring it to the various meetings, and getting it to win the features selection election from all parties. Also WG21 tends to disregard C features that can already be implemented within C++'s type system.
- peaklineops 8mo ago[dead]
- BiraIgnacio 8mo agoIf C++29 was exclusively about quality-of-life improvements, improving what exists, I'd bet the community wouldn't mind too much.
- vr46 8mo agoHosting the meeting in Croydon and not letting people leave until the thing is signed-off is definitely a cunning strategy. Never want to work down there again, ever.
- Milner08 8mo agoQuite unrelated to the main topic, but shouldn't it be Croydon, London? I have never heard anyone called it London Croydon before. Generally addresses/places go from most specific to least and given Croydon is an area of London it should go first.
- sidkshatriya 8mo agoYes, I noticed that too -- why "London Croydon" rather than "Croydon, London" ? Date in Europe: 30/03/2026 Date in China: 2026/03/30 Then you have Little Endian and you have Big Endian. TL;DR: Some humans like to talk about the specific and then the general and others vice versa. But here is really why I think the author referred to it as "London, Croydon" "London, Croydon" communicates "Hey we had this C++ standards meeting in London, one of the coolest cities in the world. (Be jealous!). We were helping add more complexity to the most complex language in the world in the lovely environment of London, England. Croydon is a piece of irrelevant detail... meeting was in London, remember that ! "Croydon, London" communicates "Hey we had this C++ standards meeting in gritty Croydon... it was in London so I guess it was OK ?? Sorry our budgets could not put us up in Westminister, London" [End of Joke]
- tialaramex 8mo agoGenerously - specifying Croydon does help travellers figure out where they need to be more specifically than just London. I'd like to hope if they met in New York City it'd say e.g. "New York - Riverdale" or something rather than leaving you to guess where in the city exactly. Most things "in" London aren't in the centre unless they're tourist destinations or they're extremely old. The most surprising thing I ran into right in the centre was the International Maritime Organisation's headquarters, which is right on the Thames because historically that makes sense in a way that arguably it already didn't when that was built, and certainly not today.
- nutjob2 8mo agoLike London Gatwick Airport? Addresses are one thing, but the inverse has its own logic. In terms of (mental) planning you want to know that you need to go to the UK then London then Croydon, otherwise there's an element of "where's that?" as you read left to right.
- superxpro12 8mo agoC++ is so tantalizingly close to being an amazing embedded c++ language if they could JUST support first-class polymorphism. Embedded is such a perfect fit for interface-based programming, but because it cant determine call resolution outside of a single source file, EVERYTHING gets vtable'd, which ruins downstream optimizations. There's some ugly workarounds.... CRTP, c-style (common header + different source files. To the person who says "use templates!".... no. I dont like templates. They are verbose, complex, and every time i try to use them they I end up foot-gunning myself. Maybe its a skill issue, but if you designed something that most people cant figure out, I'd argue the design is wrong. C++ is SOOO close to doing compile-time polymorphism. If just needs a way to determine type across source files, which LTO sorta-kinda-but-not-really does. I've seen some examples of C++ contracts replacing CRTP, but it used templates, which again, not a fan of.
- QuiEgo 8mo agoRust’s trait system and the embedded HAL say “hi there.”
- gpderetta 8mo agouse templates.
- majoe 8mo ago> I've seen some examples of C++ contracts replacing CRTP, but it used templates, which again, not a fan of. I think you meant concepts. C++ Concepts are the right answer in my opinion, if you want compile time polymorphism against an interface. I don't think, there is a way around templates, they are C++'s way of compile-time polymorphism. Other languages, which allow for compile-time polymorphism, have similar mechanisms with similar constraints. I get where you come from, when you say that you're not a fan of templates, though. At least concepts help with clearer error messages for templates. One advantage, that concepts have over CRTP is, that only consumers of your interface, not implementers, need to know about your concept.
- devnotes77 8mo ago[dead]
- DonHopkins 8mo agoDammit, it's been 28 years and they still haven't implemented my favorite C++ extension proposal, and its birthday is coming in a couple days -- it would be so much better now with all the emojis in unicode: Generalizing Overloading for C++2000 https://www.stroustrup.com/whitespace98.pdf https://www.stroustrup.com/whitespace98.pdf
- semiinfinitely 8mo agoJust in time for language deprecation
- hulitu 8mo ago> C++26 is done Now do C++27. Why do we need every year a standard ? CADT ?
- relation_al 8mo agoAs more of a C# and Java guy, I'm curious to understand something - what sort of apps do folks here build? I am very interested to hear what problems get solved with these languages today. I know there must be many use-cases, but I don't hear about them too much.