C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Floating an idea: int main(std::span<std::string_view> args)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 09 Sep 2024 10:55:34 -0700
On Monday 9 September 2024 08:34:14 GMT-7 Jarrad Waterloo wrote:
> "The children man, think of the children!"
> That was not directed at you but more generally towards all and our
> motivations and goals.
>
> More towards Lenard's point, "Existing programs could always keep using the
> existing main signature." Compilers already support multiple signatures.
> What's one or a few more that are more convenient and safer to use. As such
> it doesn't seem hard to modernize. What is hard is when we don't provide
> the option to move to! Modernization in this case is getting off the old
> and getting on with the new. If the new does not exist then what is there
> to change.

Outside of Windows, there's only *one* main signature. All the different
signatures are actually the same, because of the lack of C++ mangling of
"main".

Changes to main() may involve synchronising with WG14 and the Standard C
library implementations. Updates to the C++ Standard Libraries are difficult
enough on some platforms; updates to the C library is often prohibitive
because they're under the control of the OS vendor, not the compiler vendor.

> The gain of a simpler, safer C++ that is easier for beginners doesn't seem
> so small, especially when the work involved is so small.

Not doubting any of that.

The problem I and others are raising is that the technical challenges are big
enough that attempts at doing this have been abandoned. It's just not worth
the effort for the gain we'll get.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2024-09-09 17:55:37