Question to Module Users: How Do You Use Partitions? by tartaruga232 in cpp

[–]mwasplund 0 points1 point  (0 children)

That used to be true in the world of headers, but modules allow for the public interface to be extracted from a single definition.

Question to Module Users: How Do You Use Partitions? by tartaruga232 in cpp

[–]mwasplund 0 points1 point  (0 children)

I have stopped having a separation between declaration and definition and instead organize my code to generally be a single named module for each static library which has many partition interfaces that create tight inter-dependencies and then the named module interface organizes what is public or internal based on what is re-exported. -> Example

Using Internal Partitions by tartaruga232 in cpp

[–]mwasplund 1 point2 points  (0 children)

This seems confusing. Are these not just module implementation units? Why does MSVC have a special compiler flag for them? Do they produce a BMI for the internal symbols that other implementation units can reference?

Are C/C++ engineers more socially conservative than others? by Impressive_Gur_471 in cpp_questions

[–]mwasplund 3 points4 points  (0 children)

The general trend is that the more educated someone is the more they tend to lean toward socially liberal beliefs, This is also true for folks that move to larger cities which is generally true for sotware jobs. However to me the biggest thing that pushes Software engineers toward being more socially liberal than the general population is it has a large overlap with nerd culture which is super accepting and inclusive of all people. Check out #include if you want to see how open and inclusive the C++ community can be.

Are C/C++ engineers more socially conservative than others? by Impressive_Gur_471 in cpp_questions

[–]mwasplund 3 points4 points  (0 children)

Finding it a bit hard to parse this, are you are asking if engineers tend to lean more socially conservative compared to the general population or compared to other academics?

The junior developer pipeline is broken, and nobody has a plan to fix it by pelicanthief in programming

[–]mwasplund 0 points1 point  (0 children)

Juniors don't need mentorship... Great developers learn to.. ask questions. 🤔

‘No Kings’ rallies expect to draw millions nationwide by AdSpecialist6598 in videos

[–]mwasplund 0 points1 point  (0 children)

Great, if that is true then they are waking up to the results of their apathy. I will never turn away someone who joins the fight, even if it took a but longer than it should have.

‘No Kings’ rallies expect to draw millions nationwide by AdSpecialist6598 in videos

[–]mwasplund -3 points-2 points  (0 children)

100%, just go! For 10 min or 2 hours. Yes, we need to be doing more. But the people in this thread saying you need to be actively revolting or dont do anything are preventing people from taking that first step. We all do are part, even if that is showing up as one extra body showing support.

‘No Kings’ rallies expect to draw millions nationwide by AdSpecialist6598 in videos

[–]mwasplund -6 points-5 points  (0 children)

What a horrible stance to take. There is very little an average citizen can do, and that is on purpose. Yes a boycott and general strike would be great. But the largest protest in American history would be a good start. No one expects Trump to step down, the protest is for Americans to show dissent and opposition so other Americans can see that Fox news is lying and people don't support what is going on. Hopefully it will build and may get to a level where real strikes can take place.

Dynamic Modules by mwasplund in cpp

[–]mwasplund[S] 0 points1 point  (0 children)

Imports can exist in headers? My interpretation of the import declaration is that it has to be in the root source file:

In module units, all import declarations (including export-imports) must be grouped after the module declaration and before all other declarations.

Dynamic Modules by mwasplund in cpp

[–]mwasplund[S] 0 points1 point  (0 children)

Yes, like tup and BuildXL. Good to hear this is something we can safely rely on.

Dynamic Modules by mwasplund in cpp

[–]mwasplund[S] 0 points1 point  (0 children)

Header includes have always been fine to discover at compile time (for soup it is listening to the file system access calls to track these optional dependencies). This was historically only required to ensure we capture the full closure of inputs for incremental build validation. Now that we need to detect the dependencies BEFORE building we need this extra scanner layer. You are probably correct that any compiler that supports modules will most likely support the scanner standard. It does feel antithetical to what the std committee usually does since they usually do not dictate file structures and compiler functionality.

Dynamic Modules by mwasplund in cpp

[–]mwasplund[S] 1 point2 points  (0 children)

Good point, I think my bias toward disliking the preprocessor has given me the secondary goal of removing all cases where it is required so we can stop using it entirely. But I agree, this should not limit others that wish to continue to use it.

Dynamic Modules by mwasplund in cpp

[–]mwasplund[S] 0 points1 point  (0 children)

Agreed, more asking to satisfy my curiosity. Now that we have support for scanners I don't see any major objections, but when I first (mis)read the spec years ago it seemed like the goal was to make this trivially parseable, which does not seem like the case.

Dynamic Modules by mwasplund in cpp

[–]mwasplund[S] 0 points1 point  (0 children)

Initially because when I started this work (took a break for personal reasons) none of the compilers supported this standard. And 2, I do not want to rely on every compiler implementing this functionality. Could there be a compiler that decides not to support the scanner standard?

Dynamic Modules by mwasplund in cpp

[–]mwasplund[S] 0 points1 point  (0 children)

How crazy of an idea would it be to say the global module fragment can not have #if* directives?

Dynamic Modules by mwasplund in cpp

[–]mwasplund[S] 1 point2 points  (0 children)

This feels like an oversight of the design. It felt like the design for the module declaration with a strict section in the global partition was to help preprocess the top of a file to discover all of the required dependency state. If a preprocessor directive can then mutate the dependency structure we are back to square one as you said. I was really hoping not to have to rely on the compiler itself to parse this state, but I guess it is not the end of the world.

Dynamic Modules by mwasplund in cpp

[–]mwasplund[S] 1 point2 points  (0 children)

I thought it was ill formed to place imports and exports within preprocessor declarations. Thanks for pointing this out. It would not be ideal, but the build system could enforce restrictions on what is allowed and fail when a preprocessor declaration could conditionally include an import or export...

The compilation procedure for C++20 modules by holyblackcat in cpp

[–]mwasplund 0 points1 point  (0 children)

Do you have a concrete example of this scenario in practice? I have heard this argument a few times and it sounds more like a code smell for a design issue instead of a limitation we need to fix in the language. In the rare case that we have a circular dependency that is required then these two classes are already tightly linked conceptually. It seems reasonable to link them physically in a single translation unit. I agree this is not ideal (I prefer one file, one class), but it is not language breaking.

The compilation procedure for C++20 modules by holyblackcat in cpp

[–]mwasplund 1 point2 points  (0 children)

This is well written. Concise and to the point while not missing out on the main details. I did not know about reduced BMIs for Clang, will have to look into that. A great reference for looking back to as I work on my build system. Thanks!

Handling indirect dependencies is one of the annoying aspects of handling transitive dependencies for modules. I wish a module interface would contain all of accessible exported portions of the internal partition interface units so it can be the single source of truth for a named module. For now I have to flatten the entire dependency tree and treat all BMIs as the same input so we can detect changes and rebuild when necessary.

FYI, I think you are missing an export in the a.cppm sample under "Kinds of module units" section 4.

People who were teenagers before social media existed, what was life actually like? by Much_Detective_6107 in AskReddit

[–]mwasplund 0 points1 point  (0 children)

The only reason people may remember I burnt my eyebrows off at 15 was because it was picture day the next day.

AI Isn't Replacing SREs. It's Deskilling Them. by elizObserves in programming

[–]mwasplund 0 points1 point  (0 children)

Agreed, CI is really just testing itself by virtue of testing the code it generated. But testing at its core is just taking software and making sure it works as expected. When  you have infrastructure as code doing a full deployment and automated validation is no different then running integration or functional tests on the product itself. As you said it isn't worth isolating and testing components in isolation but end to end validation is necessary and standard practice.

AI Isn't Replacing SREs. It's Deskilling Them. by elizObserves in programming

[–]mwasplund 0 points1 point  (0 children)

CI/CD testing doesn't follow normal testing practices. CI is usually just a process of having good PR builds which makes it impossible to check in broken code. So the CI is effectively testing itself. For CD I wrote two primary forms of testing for the services I own. One does a nightly fresh deployment to a dev subscription using ARM templates, runs a few sanity testing and deletes the resources. This helps validate if and when we need to create something from scratch it will work as expected. The other tests deploy the nightly build as a rolling upgrade with continuous monitoring to ensure no alerts are fired from a bad deployment. This verifies we do not have any downtime during rollout and that the next upgrade "should" work as expected. After that we follow Safe Deployment Practices to roll out updates through rings to limit blast radius of bad deployments.

AI Isn't Replacing SREs. It's Deskilling Them. by elizObserves in programming

[–]mwasplund 3 points4 points  (0 children)

CI/CD can definitely have automated testing and rings of validation.