There is a lot of discussion of contracts in C++.https://old.reddit.com/r/cpp/comments/1nvxb8m/herb_sutter_blogmy_other_cppcon_talk_video_is_now/Mixed-mode across binaries is peculiar. One argument by some people is that to avoid issues, it might be necessary to quadruple the number of compiled binaries in some ecosystems.I wonder if an alternative in the contracts proposal could have been that the default contract mode is contract ignore-mode. And then all the other contract modes would require binaries to contain additional information indicating the contract mode. And then mandate that it is a link-time error (with always required diagnostic) to link binaries that do not have the same contract mode. With the reasoning that contract ignore-mode is meant for speed and avoiding bloat, and the other contract modes are fine with bloat.Way, way, way too late in the process, though. And my understanding of contracts and linking is very limited. And there have been other claimed issues with contract other than the modes.
>>106770824I have nothing to add regarding contracts. Figured I'd just post an article I found the other day on usage of atomics: https://abseil.io/docs/cpp/atomic_danger. Unrelated but I'm currently implementing a mix between synchronized_value (N4953) and SerenityOS's MutexProtector. I waste a lot of time reading, not much time actually getting anything done.
>>106770824Some people complain about no message in contracts, which might be annoying if contracts are supposed to replace some kinds of assert libraries.>Why is there no message??? that's like the most basic thing every assertion library has why do I have to put a static message???>I will just keep using libassert instead>No field experience, no feedback from real users, no message that you could define in your source code. I did point that little problem out in the Bulgaria meeting, and it's apparently going to be discussed in the future.I wonder if requirements analysis as part of the proposal would have been useful.
This is confusing if true. VilleVoutilainen is a major critic of contracts if I understand correctly.>For what it's worth, a description of a future extension for noexcept_enfoce, and its description by me is quoted in that talk. And it's rather epic, considering that Herb says "Ville is Finnish, he doesn't normally give glowing praise like this, he's very impressed".>I'm describing my own invention. I'm being very impressed by myself.
>>106770824>>106770879>>106770935why does /g/ obsess over sepples so muchnobody besides autistic retards actually uses this language.
>>106770970Discussion is fine, relax.
>>106770970Cope.
>>106770970the entire industry is built on C++, just because you hate the language doesn't mean you have to invent falsehoods
>>106770982>>106771004>>106771011QED
>>106770879>I waste a lot of time reading, not much time actually getting anything done.If you are researching, that might be normal.Barely related, but I remember in one job, I spent a lot of time reading, and then I began finding and fixing bugs on both my team and other teams, and teaching them, fixing bugs they had trouble figuring out themselves, because I actually understood what we were working with. A weird job, cannot recommend that situation.
>>106771097Do you have any contributions on this topic?
>>106771154>asserts are invented in the 70s>C++ finally decides it needs assertswtf is the point of this schizoid crap
>>106771169Not many programming languages actually have fullblown contracts feature. Though I am no expert on them.
>>106771209Automated spambot?
>>106771210Eiffel! I loved the language for its book. Maybe Sather.
>>106772160Eiffel is interesting. Its contracts feature does seem to appear to have affected a lot of the rest of the programming language.>The Design by Contract mechanisms are tightly integrated with the language and guide redefinition of features in inheritance:
>>106770935>37:33 "You remember when we added static_assert and then in a later standard we added static_assert where you could put comma quote error message. Useful right? We added it later - we'll add it later here." -Herb
>>106771210D has them and fwiw it seems like almost nobody uses them, at least not the open source devs.Maybe they become more important if you have huge teams
>>106770935sutter talked about thisyou can still use && "message" like C style assertsand then messages can be added in a future iteration, like what they did with static_assertthey're trying to ship a MVP for c++26 and add more features later after there is field experience
>>106770970It's a desperate attempt to avoid admitting Rust won, or they're wage cucks.C++ jobs are a humiliation ritual forcing them to pretend it's good. My last few jobs were all C++ and it's legitimately rare you find anyone who actually bothers to understand the language enough to not shoot their dick off in a million+ line of code project. Bonus that a lot of places outsource everything and stop spending on software R&D so these codebases are lead by fagman rejects or fresh college kids.
Contracts seem like a massive landmine for dubious benefit. Modules are in hell. Profiles are a perverse joke. C++ is fossilizing, and the committee is dedicated to dragging it to hell.
>>106774842>Modules are in hell.Improving, though slowly. I am not sure where they will end up.>Profiles are a perverse joke.Profiles without any code generation or runtime changes, seems like they could be good. Disallow vector<bool>, discourage obsolete features, etc., while giving an escape hatch. Maybe a bit like Javascript's "strict", except compile-time only. Profiles, without any worries about memory safety or lifetimes, still seem like they could be useful, like for easier modernization and common subset of features.>C++ is fossilizing, and the committee is dedicated to dragging it to hell.Some people like the upcoming reflection feature, I haven't used it myself.Pattern matching would be nice, hopefully it arrives in C++29 or C++32.
Decades too late for C++
>Point is, if that feature is essential to you you'll have to wait either way, so why get in the way of the rest of us who actually have a use for the current feature now? I think that is silly.There are some dangers with postponing features of a proposal, including that it might turn out later that the postponed features don't actually fit into the overall design, and cannot be included due to backwards compatibility or only at significant cost. Whereas if the features were included from the start, potential problems could have been identified and possibly fixed more cheaply or for free.Programming language design isn't easy.
>>106774174Are you just admitting that Rustroons are unemployed? Lol.C++ won, Windows won. We'll see if Rust can HANG around long enough to win.
>>106770824>*Laughs in Ada*>*Laughs even more in Eiffel*
>>106774174Retard take.
>>106774842> muh modulesSkill issue.
>>106770970Just because you're a webshitter doesn't mean other people are. C++ is still heavily used in industry to solve society's most challenging problems.
>>106770824>I wonder if an alternative in the contracts proposal could have been that the default contract mode is contract ignore-mode. And then all the other contract modes would require binaries to contain additional information indicating the contract mode. And then mandate that it is a link-time error (with always required diagnostic) to link binaries that do not have the same contract mode. With the reasoning that contract ignore-mode is meant for speed and avoiding bloat, and the other contract modes are fine with bloat.why wouldn't this fix the mixed mode issue?
>>106770824The alternative is to pretend it doesn't exist and use custom macros like a commenter already said. It's a complete meme feature that violates the very meaning of a function contract.
>>106775808There are claims that contracts in some cases and circumstances can offer optimization opportunities, but I don't know much about it or whether it's true.
>>106776129Because they are hints to the compiler.
>>106776129>>106776152>potentially unchecked/unenforced asserts being used for optimization opportunities this is going to be a disaster if any compiler actually does it.
>>106770824Is there anywhere the stances of tool makers and vendors can be seen? And Linux distribution administrators?
Will the national bodies of ISO C++ accept C++26, or reject it due to contracts?
>>106775332> C++ is still heavily used in industry to solve society's most challenging problems.You mean, it quickly identifies the troons and furries being the only ones left using it, so it's easier to round them up for gas, thus solving society's most challenging problem.
>>106779493Are you a transsexual furry? Like, what are you even writing?
>>106770824Honestly, imo pretty trash talk by Sutter's standards. As someone who hasn't looked into contracts before, it doesn't get me excited about the feature, and it seems like an awful lot of bloat to reinvent (static_)asserts. But maybe that's because I don't use runtime assertions too much (I use plenty of static_asserts though). Maybe I'll come around when this drops.
>>106779931>Honestly, imo pretty trash talk by Sutter's standardsThe quality of his talks has plummeted since Rust released. His last good talk was the atomics talk and that was back in 2012 or 2013.He's been in full on boomer shill mode where he has to defend C++ with his life and cannot positively regard newer languages. Remember the pattern matching talks that were going to revolutionize C++, then most recently reflection? And profiles, and contracts. I use to think he was alright but he really showed his ass since 2016. If you've read his profiles papers you'd see how full of absolute garbage he is, which paired with the orchestrated effort to stymie Baxter's Safe C++. I still can't believe how much of a joke profiles were, and Baxter picked them apart completely but the committee decide profiles were the future.
>>106780280>reflectionA lot of people seem to think they are going to be amazing, and they are in C++26.>profilesI am skeptical about profiles that change runtime behavior or generate code. But light and compile-time-only checking profiles could be good in practice, in my opinion.But paid rustling evangelists also shilled and manipulated to the extreme, trying to change government policy and directing funds to their own foundation, etc. That Rust is obviously not a memory safe programming language only makes matters worse.>contractsI don't know if Herb Sutter pushed them or not, I haven't looked into them a lot. They seem divisive. The current contracts proposal, accepted in C++26, builds upon previous proposals.>pattern matchingNot in C++26, there were two competing proposals, neither accepted. My guess is that there will be new and improved pattern matching proposals for C++29, the latest proposals have improved upon previous proposals.
>>106780280>Baxter's Safe C++It didn't even have an open source compiler, and involved far-reaching changes, like a new standard library if I recall correctly.
>>106780396>But paid rustling evangelists also shilled and manipulated to the extremeNot at all. There are a number of hacks that were easily preventable. If you cared about safety, you'd want to get easily misused software out of your stack or buttoned down way harder.>That Rust is obviously not a memory safe programming language only makes matters worse.You're not a serious person when you lie like that. Does no one any good except the person who can ignore what you have to say
>>106780746The only liar here is you, and you lie repeatedly.
>>106780746if rust is memory safe, then please explain why gdb and valgrind are used to debug memory unsafety ub in rust user library and standard library.https://materialize.com/blog/rust-concurrency-bug-unbounded-channels/
>>106780429This is true. IMO it should be telling that C++ is objectively unfixable that all these safer C++ basically end up being whole rewrites with very loose API-like compatibility. I honestly don't know why people don't just admit to themselves that Rust won already.
>>106780429I agree that not open-sourcing it was stupid, but he was still proposing that that work should make it into the C++ standard. They explicitly wrote a paper saying they wouldn't make any far-reaching changes then turned around and said profiles were the path forward, when they require far-reaching annotations. They sabotaged him on purpose
>>106781149Repeating lies to crab and sabotage future producers, very cool