Rust will not replace C++. Everything is thrown out the window, including develo... (2024)

Hacker News new | past | comments | ask | show | jobs | submit login

jasmer on Jan 30, 2023 | parent | context | favorite | on: Swift Achieved Dynamic Linking Where Rust Couldn't...


Rust will not replace C++. Everything is thrown out the window, including developer productivity in order to provide the 'zero overhead runtime guarantee' feature. The code ends up quite laborious, and it's just not suitable for many things, and it doesn't play so easily with C.

Most projects do not require what Rust provides at the cost it provides it at.

C++ people really wants a C++ that is clean, modern, parsable, without all the legacy cruft.

Also I think that Rust is a 'V1' version of a borrow checker and I can't wait for newer iterations which I think will be better.

Rust will not replace C++. Everything is thrown out the window, including develo... (2)

pcwalton on Jan 30, 2023 [–]


> Most projects do not require what Rust provides at the cost it provides it at.

If this is true, it's because most projects should use a GC'd, memory safe language, not because most projects should use memory unsafe languages. There is little to no place for memory unsafe languages such as C++ for new projects in 2023.

> Also I think that Rust is a 'V1' version of a borrow checker and I can't wait for newer iterations which I think will be better.

This is the literal definition of vaporware, without a specific plan for how "newer iterations" will do it better. People have been searching for silver bullets for years in this space and nobody has really found a way to improve on the balance Rust has found without introducing garbage collection of some kind. I personally don't believe a "better borrow checker" can exist without GC (which is not such a bad thing, by the way--in my experience, C++ and Rust developers tend to be unfairly dismissive of garbage collection).

Rust will not replace C++. Everything is thrown out the window, including develo... (3)

jasmer on Jan 30, 2023 | parent | next [–]


Most C++ apps are mostly memory safe and that's just fine. It's ridiculous to suggest that this secondary artifact concern is raised to primacy for all projects.

Rust V1 is a vastly complicated and verbose language, slow to make, slow to write, difficult to integrate, which offers really only one glorious feature that's not important to such a degree for most projects. To suggest wanting something better has nothing to do with vapourware.

Hypersensitivity over a compiler might be a sure sign in a cult!

Rust will not replace C++. Everything is thrown out the window, including develo... (4)

pcwalton on Jan 30, 2023 | root | parent | next [–]


> Most C++ apps are mostly memory safe and that's just fine. It's ridiculous to suggest that this secondary artifact concern is raised to primacy for all projects.

It's demonstrably not "just fine", as the steady stream of security issues that hurt real people will attest to. It's also important to remember that C++ is an extreme outlier here: the majority of programs written in 2023 are in memory-safe languages. Memory safety is not some weird new thing; it's the norm everywhere but in C and C++, usage of which declines every year.

Rust will not replace C++. Everything is thrown out the window, including develo... (5)

galangalalgol on Jan 30, 2023 | root | parent | next [–]


I think Jasmer has a good point about c++ users wanting a safe enforced subset. I jave suggested a cpp23{} to denote code where the compiler is free to break anything older and enforce best modern practices. Its like a version of safe{} vs unsafe{}

I don't agree that rust is particularly difficult to use, and certainly not verbose. My productivity level is not as high as pytorch or matlab, but it is already on par with c++17 and I've been using that for ~5yrs (c++ for 30yrs) and I've only been using rust for work projects for a year.

Lastly I agree that memory safety isn't a small thing. 70% of security vulnerabilities MS and google find they say are memory safety related. 70% of the financial losses due to security vulnerabilities is... A really big number. And rust, unlike a GC language like java, go, swift, or c#, isn't just memory safe, the borrow checker adds thread safety and more generally safe access to any resource, like file or network io. That is a huge benefit in any domain, and the cognitive overhead just isn't that high.

Rust will not replace C++. Everything is thrown out the window, including develo... (6)

lll-o-lll on Jan 30, 2023 | parent | prev [–]


Swift is memory safe. It’s the better C++ I want, just out of reach because Apple. There is at least one memory safe alternative to Rust that doesn’t require a GC.

I’ve made this argument before but here we go again. GC is great and works better and faster than reference counting in most cases, but there are degenerate cases and they matter on phones. One degenerate case is memory pressure. A GC running out of memory will perform terribly. Another case is bounded latency. Most obvious with hard real-time, but also a problem for any system where a long GC pause will lead to failure modes or user dissatisfaction. RC allows for predictable (albeit slower) performance.

So if we can agree that “no GC” is preferable in a constrained environment like a phone, but you still want memory safety, then you are left with “is Swift or Rust better for productivity?” It’s pretty obvious that the answer is resoundingly “Swift”.

Rust will not replace C++. Everything is thrown out the window, including develo... (7)

pcwalton on Jan 30, 2023 | root | parent | next [–]


Reference counting is a form of garbage collection, and therefore Swift is a GC'd language.

Rust will not replace C++. Everything is thrown out the window, including develo... (8)

zozbot234 on Jan 30, 2023 | root | parent | prev [–]


Ubiquitous ARC has even worse performance than tracing GC. Only Rust gives you complete memory safety with fine-grained control over memory management strategy.

Rust will not replace C++. Everything is thrown out the window, including develo... (9)

lll-o-lll on Jan 30, 2023 | root | parent | next [–]


Swift has some tricks to make things faster than naive ARC, but the point is that you trade a little speed for deterministic behavior. The post I was replying to was making the argument I see frequently. That if not Rust, you should go GC. This is simply wrong. The degenerate GC cases can be avoided with Swift. It’s better for a phone application in nearly every case. If it wasn’t bound to Apple, I’d say it’d be a better choice than Rust in 90% of the places Rust is used.

Rust has its place, but the idea that it’s the obvious and only replacement for C++ is overblown. A language like Swift seems like a better path forward.

Rust will not replace C++. Everything is thrown out the window, including develo... (10)

jasmer on Jan 30, 2023 | root | parent | prev | next [–]


"Only Rust gives you complete memory safety with fine-grained control over memory management strategy."

Yes, and it comes at a cost. Pay that cost for those advantages if necessary. Otherwise, use something else.

Rust will not replace C++. Everything is thrown out the window, including develo... (11)

pjmlp on Jan 30, 2023 | root | parent | prev [–]


Rust isn't the only one with affine types, only the one that has managed more mindshare.

Rust will not replace C++. Everything is thrown out the window, including develo... (12)

Jweb_Guru on Jan 30, 2023 | root | parent [–]


None of the other languages you're thinking of are particularly usable as industrial strength languages for general purpose programming, for reasons that go way beyond mindshare.

Rust will not replace C++. Everything is thrown out the window, including develo... (13)

pjmlp on Jan 30, 2023 | root | parent [–]


Mind reader?

Rust will not replace C++. Everything is thrown out the window, including develo... (14)

Jweb_Guru on Jan 31, 2023 | root | parent [–]


I don't need to be a mind reader because I know which languages other than Rust support sound affine types. They broadly fall into three categories:

* Languages with comprehensive support for affine types, but that are otherwise too limited to be really useful for general purpose programming. Usually this is due to a lack of industry support.

* Languages with bolted on support for affine types where you can't get consistent performance benefits out of code written in that style and it's very difficult to write and compose code written in that style.

* Complex languages with advanced type systems that can emulate affine types, and are extremely powerful, but are borderline unusable for any purpose.

Like I said, whichever of those three language categories you're thinking of, my reasoning applies. No mind reading necessary! I understand though that you believe safe concurrency has been solved since Modula 3 because you can just lock every object while it's in use (why didn't anyone else think of that?), so maybe you don't really appreciate the vast gulf in usability between affine types in these kinds of languages and in Rust.

Rust will not replace C++. Everything is thrown out the window, including develo... (15)

pjmlp on Jan 31, 2023 | root | parent [–]


See you don't know which languages I mean.

I never said such thing about Modula-3, but I do believe indeed that Rust doesn't solve the concurrency problem when accessing external resources in distributed computing.

It is nice it has an answer for data concurrency for internal in-memory data structures, that is a tiny slice of solving distributed computing access patterns.

Like those languages that you "know", Rust's place is being specialized on deployments where no form of automatic memory management is allowed.

Rust will not replace C++. Everything is thrown out the window, including develo... (16)

Jweb_Guru on Jan 31, 2023 | root | parent [–]


Nice goal post moving. So which imaginary language with affine types are you referring to? Being specialized doesn't automatically mean being industrial strength or usable.

Rust will not replace C++. Everything is thrown out the window, including develo... (17)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rust will not replace C++. Everything is thrown out the window, including develo... (2024)
Top Articles
Professional Indemnity vs. Public Liability
Why is financial literacy essential for success in the modern economy?
Ron Martin Realty Cam
Edina Omni Portal
Visitor Information | Medical Center
Identifont Upload
Milk And Mocha GIFs | GIFDB.com
Find your energy supplier
Jscc Jweb
Builders Best Do It Center
Summoners War Update Notes
U/Apprenhensive_You8924
Hair Love Salon Bradley Beach
Rhinotimes
The ULTIMATE 2023 Sedona Vortex Guide
Cvb Location Code Lookup
Unit 33 Quiz Listening Comprehension
3S Bivy Cover 2D Gen
My Homework Lesson 11 Volume Of Composite Figures Answer Key
Beryl forecast to become an 'extremely dangerous' Category 4 hurricane
Acts 16 Nkjv
Fsga Golf
PCM.daily - Discussion Forum: Classique du Grand Duché
Best Boston Pizza Places
Hannah Palmer Listal
Sienna
Ltg Speech Copy Paste
Cognitive Science Cornell
Mikayla Campinos: Unveiling The Truth Behind The Leaked Content
CohhCarnage - Twitch Streamer Profile & Bio - TopTwitchStreamers
Log in to your MyChart account
Japanese Emoticons Stars
Ewg Eucerin
Sony Wf-1000Xm4 Controls
Darknet Opsec Bible 2022
Salemhex ticket show3
Home Auctions - Real Estate Auctions
Pitco Foods San Leandro
World History Kazwire
Thanksgiving Point Luminaria Promo Code
Electronic Music Duo Daft Punk Announces Split After Nearly 3 Decades
Uvalde Topic
O'reilly's El Dorado Kansas
Ghareeb Nawaz Texas Menu
Craigslist/Nashville
Terrell Buckley Net Worth
Lightfoot 247
French Linen krijtverf van Annie Sloan
10 Bedroom Airbnb Kissimmee Fl
Bones And All Showtimes Near Emagine Canton
Law Students
Emmi-Sellers
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 6171

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.