this post was submitted on 02 Mar 2025
36 points (97.4% liked)

C++

1920 readers
2 users here now

The center for all discussion and news regarding C++.

Rules

founded 2 years ago
MODERATORS
 

Bjarne Stroustrup, creator of C++, has issued a call for the C++ community to defend the programming language, which has been shunned by cybersecurity agencies and technical experts in recent years for its memory safety shortcomings.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 8 points 2 weeks ago* (last edited 2 weeks ago) (3 children)

Just use Rust. Eazy Peazy. C++ will likely be still be used because it's just not realistic for some softwares to switch to a safer programming language.

[–] [email protected] 9 points 2 weeks ago* (last edited 2 weeks ago)

I feel like it's just a matter of time.

Since someone managed to make an event based library in Rust, I don't think we need to stop at it.
As long as some of the problems with the borrow checker with large code-bases can be fixed, it should be usable for pretty much every application.

On the other hand, all we have done is changed the terms of "don't make it crash" to a simpler, "don't use unsafe". That, I feel, would eventually bring up similar problems in different ways from what we have now.


On the other, other hand, until my concentration becomes so bad that I am not able to handle my memory allocations, I will not stop using C++

[–] [email protected] 9 points 2 weeks ago (1 children)

I will use Rust when const generics are actually useful and we get some viable alternative to variadic templates.

[–] [email protected] 2 points 1 week ago* (last edited 1 week ago)

I know very little about C++, can you help me understand at a very basic level what variadic templates are? Is it about a template taking a varying number of generic types? If it is, then you can get something very similar in Rust by implementing a trait for tuples of various lengths.

[–] [email protected] 7 points 2 weeks ago (1 children)

Until chip manufacturers officially support rust, my clients will not want me to use an unofficial crate no matter how good it is.

[–] [email protected] 2 points 1 week ago (1 children)

ESP32 has official support, and others are working on it. I think it will come sooner than you and I might think

[–] [email protected] 2 points 1 week ago (1 children)

I hope that it comes sooner than later. But I cannot offer Rust to most of my customers until it is officially supported.

[–] [email protected] 2 points 1 week ago

Of course! If you can, ask your vendor about it. If enough of their customers ask they will likely invest in it