![](/static/66c60d9f/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/170721ad-9010-470f-a4a4-ead95f51f13b.png)
A better language wouldn’t have any need to use POSIX signals in this way.
A better language wouldn’t have any need to use POSIX signals in this way.
I really don’t think that there is any perfect programming language.
You’d be wrong 🦀🦀🦀🦀🦀
I think a long time ago a vicious cycle began in the advertising space where predatory ads had more incentive to pay for ad space, so sensible people start to perceive ads in general as predatory. Now no sensible advertiser that’s trying to promote a legitimate product for legitimate reasons will do so by buying ad space, thus reinforcing the increasingly accurate perception that all ads are predatory.
Still much better than C++ templates, and I say that as someone who used to genuinely love C++ template metaprogramming. Admittedly Rust traits+generics are far more limited than C++ templates, but very often I find that to be a positive. The list of things that I feel traits+generics are missing is small and rapidly shrinking.
A good enough compiler would prevent them from happening 🦀
Sorry to be pedantic but Rust only guarantees no data races can happen. It does not prevent race conditions more generally.
Don’t get me wrong, I absolutely love the language for sparing me from the hell that is data races, but the language alone won’t solve race conditions for you.
I use thread sanitizer and address sanitizer in my CI, and they have certainly helped in some cases, but they don’t catch everything. In fact it’s the cases that they miss which are by far the most subtle instances of undefined behavior of all.
They also slow down execution so severely that I can’t use them when trying to recreate issues that occur in production.
I’m not sure if you’re genuinely asking what a test suite is or if this is a sarcistic joke about how no one bothers to test their C++ code.
And even if you do get to use pure modern C++ you’ll still get burned by subtle cases of undefined behavior (e.g. you probably haven’t memorized every iterator invalidation rule for every container type) that force you to spend weeks debugging an inexplicable crash that happened in production but can only be recreated in 1/10000 runs of your test suite, but vanishes entirely if you compile in debug mode and try to use gdb.
And don’t even get me started on multi-threading and concurrency.
There’s a difference between “You have to decide when to synchronize your state” and “If you make any very small mistake that appears to be perfectly fine in the absence of extremely rigorous scrutiny then this code block will cause a crash or some other incomprehensible undefined behavior 1/10000 times that it gets run, leaving you with no indication of what went wrong or where the problem is.”
I’m not saying you can’t do multi-threading or concurrency in C++. The problem is that it’s far too easy to get data races or deadlocks by making subtle syntactical mistakes that the compiler doesn’t catch. pthreads does nothing to help with that.
If you don’t need to share any data across threads then sure, everything is easy, but I’ve never seen such a simple use case in my entire professional career.
All these people talking about “C++ is easy, just don’t use pointers!” must be writing the easiest applications of all time and also producing code that’s so inefficient they’d probably get performance gains by switching to Python.
Your graph also cuts out early. Eventually you want to get performance gains with multi-threading and concurrency, and then the line drops all the way into hell.
deleted by creator
You have a talent for metaphor.
In Deep Space 9 there’s an episode called “Trials and Tribble-ations” where a number of the crew from DS9 go back in time and find themselves in the TOS episode “Trouble with Tribbles”. The producers literally overlayed the DS9 cast onto TOS footage, and shot some new clips in the same setting, so canonically the DS9 crew was present for the events of the TOS episode (… at least as canonically as you can get when time travel is involved).
Warf and O’Brien were two of the DS9 crew involved in that episode, and they also happen to be on the Enterprise when Scotty is found trapped in a pattern buffer.
Mirror universe Janeway would use the caretaker technology to conquer the Delta Quadrant and become the Borg queen without even being assimilated.
Personally I think the “compiling Rust is slow” narrative comes from comparing it against scripting languages like Python. If you compare compiling Rust against compiling C++ code of similar complexity, I think Rust will come out very favorably since C++ templates and headers tend to carry a huge compilation burden.
Yeah the only way it would be that high is if it lumps C and C++ together. But at that point it may be an underestimate.