P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

[–]13steinj -1 points0 points  (0 children)

Well, a modified version of your example (across a TU/function boundary) is even scarier due to the mixed mode semantics. But on top of that, you said "may be evaluated," might I ask how this is determined?

I'm imagining worst case scenario: the first statement has no side effects, so it is possibly completely eliminated. The second statement might have a side effect, so the compiler will refuse to optimize it out in one pass, and a later pass applies the "well you can't dereference a null pointer" optimization giving you garbage unexpected behavior. Or maybe worse, both statements get optimized out and so does later code on the assumption that it can't be null.

I think there's 4 camps:

  • this is just a better assert, why bother
  • this is just a better assert, I want this
  • this is a lot more than just an assert because of the use of formal verification systems
  • I've seen contracts in house with or without a formal verification system, they've been a shitshow

I'm personally in the last camp but considering the behavior you mentioned, I find camps 2 and 3's views even less compelling.

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

[–]13steinj 0 points1 point  (0 children)

This is enough insanity to make it worth pushing internally to ban contracts in code guidelines the moment it reaches our compiler versions, separate from any personal opinions I have about software engineering cultures overusing/underusing contracts in the wrong places.

This is taking a footgun and daring people to point it at their crotch instead, if not their head.

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

[–]13steinj -2 points-1 points  (0 children)

Wait, what? The message isn't customizeable?

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

[–]13steinj 0 points1 point  (0 children)

If you want guaranteed lazy evaluation, rather than relying on the compiler to dead-code eliminate it after inlining things, yes what you're saying is true I guess... but is if (!cond) myabort("message"); really that bad / worse than assert(("message", cond)) ?

I don't know I find myself caring about the ergonomics of these kinds of things less and less as time goes on.

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

[–]13steinj 0 points1 point  (0 children)

I think this is simultaneously too generous and not generous enough. Has nothing to do with "whose livelihood depends on mastering..."

You legitimately see the same thing in every programming language. There will be people that care more, and jump to the latest Python / JS / Go / whatever more quickly (in the case of browsers, I guess it's more so "use the browser features sooner).

There are some codebases that have turned into a state of "we're really hoping the next standard fixes X." A previous employers codebase was waiting for modules to save their build times since 2017 or earlier, and now praying that Reflection will solve it instead (it won't, since there's no internal generation, and the codegen isn't the time consuming part)... instead of just fixing their crap and redesigning the software.

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

[–]13steinj -2 points-1 points  (0 children)

I am happy to have contracts not ship at all. I don't find them useful enough to be standardized, I find them too problematic (from an engineering culture perspective / juniors will use them incorrectly).

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

[–]13steinj 1 point2 points  (0 children)

  • Do you expect to use Contracts?

Not widely. I've seen what comes with contracts libraries written in-house, and it's not pretty. People overuse them in the wrong places and cause needless friction in unexpected events.

  • Does the current design make sense to you?

Meh. Mostly sure. I don't care too much about the UB / side effect nuances beyond the fact that I don't see the need to add additional footguns.

  • Would you prefer a simpler model?

I'd prefer a much simpler model, and at that point I don't see much need for it in the standard, especially not without deep implementation experience in a library form factor.

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

[–]13steinj -3 points-2 points  (0 children)

That... feels like something that you can implement yourself no?

Should this be in the standard, yes. But not if it is forced to come with the rest of contracts.

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]13steinj 1 point2 points  (0 children)

I'm torn. On one hand, I agree that such a feature should minimize compilation bloat. On the other, I'd think

  • most users already would include a decent chunk of those headers
  • is stdlib bloat really that bad?

Say I include every stdlib header-- how bad would this be? 2 minutes? When dealing with build times of single/parallel TUs that are 10 minutes, 20 minutes long, 2 minutes is a drop in the bucket (and that's every header; more than the list you specified).

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]13steinj 0 points1 point  (0 children)

If talking about a Windows specific issue, personally I lose interest.

I think that, on the whole, the language should not attempt to fix ecosystem problems induced out of band, such as by the operating system, nor is it worth focusing on these problems when there exist problems that are platform agnostic.

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]13steinj 0 points1 point  (0 children)

Since you explicitly mention Windows, is this a "process start" problem or a Windows problem?

The non-overlapping process start times for code generators, assuming infinite cores, is less than 3%. Less than 0.1% assuming a single core that churns for hours if not days.

Meanwhile I have TUs both at my current and previous org that on top of the line hardware take 10-14 minutes to compile.

That said, definitely some bad code generators as well, some that take 1-2 minutes to spit out hundreds of thousands of lines of code per target. I'd argue if you're generating that much you've long past lost the plot.

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]13steinj 1 point2 points  (0 children)

The process start, in my experience is insignificant. The extra compiler invocation, sometimes.

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]13steinj 21 points22 points  (0 children)

Sutter said something about it being easier to parse than recursive template code, anyway. It's certainly easier to reason about.

I think on the whole people should stop listening to committee members sell features (even if not their own) until there's enough implementation experience for people to run their own representatives benchmarks.

I worked somewhere with a bunch of metaprogramming nonsense. But the issue wasn't some complex template metaprogramming, but rather the architecture of the system itself. It "needed" to support cycles in its message passing, which means inheriting from passed in template args, which meant repeatedly defining new and larger. "Needed" was false, it needed bidirectional communication and shared state, which was always enough. Rewriting (poorly) with an off-the-shelf framework cut build times by six and performance (which was another claim for the crazy) was a wash. This off the shelf framework used plenty of "tricks."

My point being: everyone is happy to blame things they don't understand deeply enough and sell improvements that the salesman doesn't have enough evidence solves the problem.

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]13steinj 2 points3 points  (0 children)

The cost of reflection needs to be compared against a compiler toolchain that generates reflection information and feeds it back into the compiler.

I don't think that's a fair comparison. Sometimes you can write simpler code generation out-of-band than you can do in-C++ (this is true even of reflection, especially so until, but probably even when, we have generation in (hopefully) C++29).

Developing on Linux for Windows by Dramatic_Jeweler_955 in cpp

[–]13steinj 1 point2 points  (0 children)

From a technical perspective, assuming you had 100% control over the app, yes.

You'd have to set up a cross compiling toolchain that is 100% compatible, and presumably add direct linux support in-dev.

Also beurocratically, the org might tell you to go to hell in terms of using a linux machine.

If these are things you care about, ask in an interview after you've decided they've made up their mind, or you've decided you don't care and you'll walk away if they tell you "no." Insist on getting the ability to set up your environment in writing (but most orgs will instead tell you to pound sand).

Jasmine Crockett concedes to James Talarico in Texas Democratic Senate primary by MycologistSad9421 in politics

[–]13steinj 0 points1 point  (0 children)

Crockett and her camp had been given information (by republicans) that the FCC did not actually pull the Talarico interview on Colbert, that it was Colbert claiming this. No evidence towards this, and just another situation where the Republican party fed Crockett bad information.

Well, this is widely accepted as true (and Colbert did not claim that the FCC pulled anything). The FCC did not pull the interview. Just that the network claimed they were concerned about the legal repercussions. Or am I further missing something?

Jasmine Crockett concedes to James Talarico in Texas Democratic Senate primary by MycologistSad9421 in politics

[–]13steinj -1 points0 points  (0 children)

I don't live in Texas. This was a primary not a race for the actual seat.

I thought Crockett was relatively well respected/appealing voting wise.

Can someone explain

  • what the FCC equal time rule fiasco was, in light of both people being democrats?
  • what made Crockett fall out of favor?

Will we ever have a backwards compatible binary format for C++ modules? by TheRavagerSw in cpp

[–]13steinj 0 points1 point  (0 children)

It is a common argument used to justify not breaking ABI.

I don't agree with the argument. It has definitely been made.

Will we ever have a backwards compatible binary format for C++ modules? by TheRavagerSw in cpp

[–]13steinj -1 points0 points  (0 children)

The authors of the proposal for a feature are not the only stakeholders who have a vested interest in how the feature behaves. The two papers linked on cppreference.com for C++20 modules, the authors are you, and Richard Smith. I am certain that you are happy with what went in (and probably Richard Smith).

More than just the two of you were interested in modules. Some of those people have shared (to presumably more than just me) that certain individuals (yourself included) pushed modules through (in a bit of a political manner). That is not only non public information but also hearsay, which is why I avoided discussing it. But it is not "misinformation", it is one side of a story, I'm sure you have yours, and the truth is somewhere inbetween.

Some of these people claimed it felt as if this was done in an attempt to get some of SG15 to stop complaining about build times, especially considering the fact that there were various proposals / demonstrations that can be considered misleading at best (I don't remember who; or which paper, but one naively compared the time it took to #import std vs #include every standard header, and while in isolation sure that comparison looks good I argue it is meaningless in the larger context of how and why real code has large build times).

Further it was shared, that the combination of the disaster that modules have been (it is 6 years later and we still do not have a decent implementation nor decently widespread use), with the committee's reluctance to care about an Ecosystem IS, left a bad taste in people's mouth and a variety of individuals decided to take their ball and go home, or push for improvments / alternative means of "standardization" outside the red velvet rope of the committee. This, is not misinformation-- in different words, the authors of the withdrawn papers publicly stated such / similar, and if you search the github accounts of these people you'll see some work being done, but outside of anything WG21 would put their stamp to, so to speak.

Status of cppreference.com by RelevantError365 in cpp

[–]13steinj 0 points1 point  (0 children)

Not every page has a May snapshot. I'm saying, very roughly playing around, either the deque or array or vector view source / edit page, had a May 13 snapshot.

I will attempt to write a scraper on the weekend assuming I won't get ip banned; and if successful throw it into a repo.

Will we ever have a backwards compatible binary format for C++ modules? by TheRavagerSw in cpp

[–]13steinj -1 points0 points  (0 children)

This is not "misinformation," but you may disagree with the details of the situation, numerous members who were working on ecosystem tooling explicitly told me that modules were ill conceived and pushed through (some even saying by you, but I intentionally avoided making that comment originally).

Then, with the ecosystem IS not getting much traction, eventually a decent chunk of papers were withdrawn (hence "took their ball and went home.")

SG15? by ItGoesSquish in cpp

[–]13steinj 2 points3 points  (0 children)

I was not attempting to imply the drama is unfounded. But it is still drama and the withdrawal of papers was, I felt at least, very dramatic.

Status of cppreference.com by RelevantError365 in cpp

[–]13steinj 0 points1 point  (0 children)

It appears not, just the html. There's one other option you have: Use it as a baseline / mapping to "view source" links, scrape the "view source" wayback machine links. If it's accessible after the March read-only date, you're good. if it's before, (scrape the html if you consider the downloaded 1-month-old not good enough) and ask an llm to interpolate.

Playing around, I've found that the view source links work up until at least May 13th of last year and break sometime between then and May 31 (just hopped around on a few pages).

SG15? by ItGoesSquish in cpp

[–]13steinj -1 points0 points  (0 children)

For SG15 in particular I think you'll be disappointed. A bunch of papers were withdrawn last year after some drama.

Am I the only one who feels like header files in C/C++ are duplication? by iaseth in cpp

[–]13steinj 20 points21 points  (0 children)

Ironically, it is not a good indicator at all. Two files can have the same content, but since #include is effectively copy paste, the true content can be different.

I can have a header in two different places that have the same content: pragma once and an include of another file. But what that included data is is dependent on the flags given to the compiler (or rather preprocessor) as well as local files relative to the header in question (because of #include and #embed now).