3 ms·
It's because c or c++ hasn't had a decent alternative for a long time. Rust has the ability to compete with them. Other languages don't. So it's ripe for distr
by UK-Al05 6y ago
It's because c or c++ hasn't had a decent alternative for a long time.
Rust has the ability to compete with them. Other languages don't. So it's ripe for distrupting projects that are normally written in c.
- badsectoracula 6y agoThere have been alternatives to those languages pretty much as long as they existed. Pascal was a common alternative to C for example, as was Object Pascal for C++ (both appearing around the same time) and Ada also existed for years and provided a much safer alternative to any of those while still being usable for low level programming. Yet C and C++ still persisted. What makes Rust different this time?
- UK-Al05 6y agoThey don't provide as much advantage over c to make the transition worth it. Rust has more advantages than Pascal. A single implementation. A decent package manager, lifetimes, sum types, all the infrastructure around sum types etc
- badsectoracula 6y agoPascal had a single defacto implementation (UCSD Pascal at first, Borland later) for each of the platforms so that wasn't really much of an issue. Ada is a standardized language. And C and C++ (especially C++) were not standardized for a long time and even after they were, most programs relied a lot on compiler-specific behavior. Pascal does have sum types (called variant records) and AFAIK had those since the beginning. Not sure about how exactly Ada does its memory management, but AFAIK it isn't a free-for-all like in C or C++, most dynamic objects are stored in containers which handle memory and any custom memory management must be done in explicitly designated ways (which it doesn't sound very different than Rust's unsafe code). So while Rust does add some stuff, i do not think that they are that much of an improvement over other existing languages (remember that many thought C was a step backwards compared to what other languages provided even at the time). Rust may add a lot compared to C, but very little when compared to other languages. Also note that i brought up Pascal and Ada as examples here, but those aren't the only alternatives to C and C++ that existed, just a couple that came to my mind. Of course there have been other languages.
- zozbot234 6y agoAda has no equivalent to Rust's borrow checker. It uses C-like memory management (malloc+free) plus idiomatic patterns somewhat like C++.
- badsectoracula 6y agoI know, however unlike C++ in Ada releasing memory doesn't seem (from the little i've seen) as straightforward as in C or C++ (or Pascal for that matter) so it is a bit safer than those, even if not as safe as in Rust. Which is really what i refer to above - compared to C or even C++, Rust does add some things but other languages that existed for years (decades in some cases) added to C and C++ and compared to those Rust doesn't add that much (which isn't the same as adding nothing). Yet these languages weren't really adopted and people remained with C/C++. Do you really think that what Rust provides will succeed in making people adopt it when other languages failed (and let's be honest - while Rust adds some stuff it isn't like it has all the features other languages have either)? Is it even a matter of features (be it about memory safety or anything else) in the first place?
- swsieber 6y ago> Do you really think that what Rust provides will succeed in making people adopt it when other languages failed Given the ever broadening adoption of Rust, I'd say it'll definitely have a large foothold. I don't know that anything, no matter how good it is, will every fully replace C or C++. But I think a lot of projects that don't need a specialty compiler (embedded or stuff like game consoles) will start picking up Rust instead of C or C++.
- deleted 6y ago[deleted]
- codeflo 6y agoPascal is a neat little language, but are you really trying to claim that its features are on par with Rust? The grandparent poster might not have picked the best examples (I’d have chosen traits, zero-cost lambdas and syntax macros), but the point is, Rust’s abstractions are inspired by decades of PL theory research that haven’t made their way into any Pascal dialect that I know of.
- ris 6y ago> A single implementation I consider this one my biggest concerns about adding a Rust dependency to a core package. Especially when in https://forge.rust-lang.org/release/platform-support.html https://forge.rust-lang.org/release/platform-support.html "Tier 1" is so small.
- sa1 6y agoThe existence of HN and a way to get developer attention?
- scythe 6y agoRust competes on performance and portability far better than Ada did at the time. It's also at parity in features and price, whereas Ada lacked proper OO and cost money until the Air Force paid for GNAT in the '90s. Modern Ada is a nice language, but pre-1995 Ada lost to C++ for a reason. Soon after that, Java showed up and offered a new, easier way to write safe programs, while also locking in the expectation that "modern languages look like C". Pascal, by contrast, simply didn't offer any compelling advantages.