C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Freestanding std modules

From: Marcin Jaczewski <marcinjaczewski86_at_[hidden]>
Date: Sun, 30 Jun 2024 16:35:19 +0200
niedz., 30 cze 2024 o 15:33 Jonathan Wakely <cxx_at_[hidden]> napisaƂ(a):
>
>
>
> On Sun, 30 Jun 2024 at 13:30, Marcin Jaczewski via Std-Proposals <std-proposals_at_[hidden]> wrote:
>>
>> On GCC mailing list I notice email:
>> https://gcc.gnu.org/pipermail/gcc/2024-June/244252.html
>> Aside of misguided author (profanities & sending it to gcc instead of here)
>> some of his concerns could be valid.
>
>
>
> Nothing that abusive clown ever says is worth listening to.
>
> He can't even write an email properly, what is all the copy+pasted junk at the top saying "
>
> Contribute to cppfastio/fast_io development by creating an account on GitHub.
> github.com"
>
>
> Do you really want to promote the unhinged rant of an abusive troll who attacks, harasses, and wishes death on the people trying to improve C++?
> What is his "concern"? He's added a #error to his project nobody uses so that if you use a compiler that supports C++20 modules you can't use his code. How is that reasonable?
>
> If you're going to boost his harassment, you get to go to /dev/null too, so I won't bother responding to the questions below (which have no supporting evidence for the "concerns" anyway).
>
>

Hard to name it as "harassment" if the author could not even
correctly target an accurate "target" for his rant,
is more yelling at clouds.

Besides I said that he used profanity,
I did not try to trick anyone into reading his rant.

I am more interested not in his reaction
but what triggers it that could have some connection to reality.
Usually people like this focus too much on some real details and
if someone changes it in a way they do not like,
they react with an over emotional reaction.

I only include him as a reference because it makes me think about
this possible problem. We can ignore him in further conversations.




Back to the real problem, how can the compiler know how much he can
discard from module include?
Ville said that ODR-use should be sufficient. But what if modules had
static variables that have
non trivial constructors that could have side effects.

Consider:

```
import RandomModuleWithStaticObject;

int main()
{
}
```

I do not ODR-use anything directly but static variable
could pull the whole module to binary.
Imagine some callback registration.

And std have `std::cin` that could trigger similar behavior.
I recall there was already some special handling for it
to avoid static initialization order fiasco.

It could be some matter in it as MSVC had an option for `std.core`.
Another is freestanding where `import std;`
is not `import std;` from the normal version.



>>
>>
>> Example: there is a freestanding version of the standard library module?
>>
>> Or how to reduce blot that `import std;` can cause even if I only
>> use part of it like `std::vector` or `std::unique_ptr` but
>> I do not plan touching `std::regexp` or io.
>>
>>
>> Maybe something like `import std.core;` (like MSVC did) or
>> use import headers like `import <iostream>;`?
>>
>> Or is this simply a QoI issue and the committee does not need to consider
>> how big is binary after `import std;`?
>>
>> --
>> Std-Proposals mailing list
>> Std-Proposals_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-06-30 14:35:33