C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Rust vs C/C++ vs C++ Superset

From: Jarrad Waterloo <descender76_at_[hidden]>
Date: Wed, 28 Sep 2022 09:30:25 -0400
*On 9/27/22 12:39, Jason McKesson via Std-Proposals wrote:*


*Give us a 3 paragraph summary of what exactly you want changed in the
C++ standard. No links, no off-ML resources. Just state plainly the
exact thing you want changed in the C++ standard. I'm not asking for
standardese; I'm asking for the specific thing you want the language
to do.*


Have you considered the following:

1) implicit constant initialization i.e. const + constexpr +
const-initialized == constant == read only static storage duration
2) easier explicit constant initialization i.e. contant or constinit on
temporaries == const + constexpr + assert that const-initialized
3) being able to change the default scoping of temporaries from statement
scope (C++) to block scope (C) to variable scope (C/C++) which is better
than both
4) returning reference to direct, non static, non pointer, non reference,
local variable is always a problem and as such should be an error instead
of a warning
...
5) turning off pointers in modules for those who don't use them; more
likely used library users and high level library writers instead of low
level library writers

Collectively, these 5 items can reduce C++ memory issues by 80++++++% for a
large portion of C++ users; 40++++%/80++++++% for low level programmers.

All of these are easy to understand.
Most of these should be easy to implement especially compared to what is
out there.
All of these fix dangling, reduce dangling and produce errors instead of
warnings.

implicit constant initialization
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2623r2.html

The other proposals will be posted by the 15th and usually available by the
24th. I have attached them in the meantime.

implicit constant initialization
temporary storage class specifiers
F43 direct dangling reduction
C++ is the next C++




On Wed, Sep 28, 2022 at 12:42 AM Phil Bouchard via Std-Proposals <
std-proposals_at_[hidden]> wrote:

>
> On 9/27/22 12:39, Jason McKesson via Std-Proposals wrote:
>
>
> Give us a 3 paragraph summary of what exactly you want changed in the
> C++ standard. No links, no off-ML resources. Just state plainly the
> exact thing you want changed in the C++ standard. I'm not asking for
> standardese; I'm asking for the specific thing you want the language
> to do.
>
> What I am proposing here is to create a framework to allow the addition of:
>
> - implicit parameters;
>
> - implicit class members;
>
> - implicit function variable instances;
>
> - implicit compound statement variable instances;
>
> - implicit file-scope static variable instances.
>
> For "local" (non-system) files that are being compiled for a local
> project.
>
>
> The goal is to standardize the addition of:
>
> - deterministic memory managers (such as root_ptr:
> https://github.com/philippeb8/root_ptr);
>
> - any other alternative memory manager;
>
> - portable backtraces;
>
> - compile-time profilers.
>
>
> For example it could add the following:
>
> 1) Class members for top-level classes (classes with no parent):
>
> class A
> {
> protected:
> boost::node_proxy & __y;
>
> ...
>
> 2) Implicit parameters and compound statement instances:
>
> boost::root_ptr<test> foo(boost::node_proxy & __y)
>
> {
> boost::node_proxy & __z = __y();
>
> {
> boost::node_proxy & __x = __y();
> boost::stack_node_proxy __y(__FILE__, __func__, __LINE__, __x());
>
> ...
>
> 3) ...
>
>
> I know this works because I already tested it with the C++ Superset. But
> like Sebastien was stating, this would aim the C++32 or the C++26 standards
> or hopefully before that.
>
> The framework is not defined yet but that's the big idea. This would allow
> to recompile legacy code correctly as well and forget about 70% of the
> cybersecurity issues caused by memory bugs.
>
>
> Thank you,
> --
> [image: Logo] <https://www.fornux.com/>
> *Phil Bouchard* [image: facebook icon]
> <https://www.linkedin.com/in/phil-bouchard-5723a910/>
> CTO
> T: (819) 328-4743
> E: phil_at_[hidden] | www.fornux.com
> 1188 rue Saint-Louis | Gatineau (Qc), J8T 2L8 Canada
> [image: Banner] <https://goglobalawards.org/> Le message ci-dessus, ainsi
> que les documents l'accompagnant, sont destinés uniquement aux personnes
> identifiées et peuvent contenir des informations privilégiées,
> confidentielles ou ne pouvant être divulguées. Si vous avez reçu ce message
> par erreur, veuillez le détruire.
> This communication (and/or the attachments) is intended for named
> recipients only and may contain privileged or confidential information
> which is not to be disclosed. If you received this communication by mistake
> please destroy all copies.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2022-09-28 13:30:38