3 ms·
They 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 ma
by UK-Al05 6y ago
They 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.
- badsectoracula 6y agoNo, i only mentioned that sum types exist in Pascal - and existed in other languages too before Rust. But my main point of bringing up Pascal was that it existed for decades before Rust, it provides at least the same functionality as C (in fact, even late 80s Turbo Pascal has more functionality than C), is safer than C while still providing as much low level functionality as C, yet it never supplanted C. Which makes me wonder how much programmers who use C really care about those features in the first place.
- UK-Al05 6y agoCan you pattern match using variant and use it as a result type, or option type with associated bind, map and other functions?
- badsectoracula 6y agoYou can use the variant as a result, yes. It is somewhat like a struct with a tagged union in C. The only functionality standard Pascal offers is the simplest "case" statement where you can match against the variances with only little more functionality than C's select statement (you can have multiple values per case and you can use ranges), but nothing more than that. In modern Object Pascal it might be possible to implement the functionality using generics and anonymous functions (currently only available in Delphi but soon also in Free Pascal), but AFAIK there isn't any functional programming-like functionality out of the box. In general Pascal is largely an imperative programming language and even in the more advanced dialects there is almost no functional programming functionality.
- 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.