“apparently it’s a better safer C++, but I’m not going to switch because I can technically do all that stuff in C++”
The main difference between C++ and D was that (for most of the time in the past) D required a garbage collector.
So, D was a language with similar Algol-style syntax targeting a completely different niche from C++.
Trying to correct your quote, it should read something like “I’m not going to switch because I can’t technically do all that stuff in D that I’m doing in C++” for it to make any sense.
I’ve never used Rust but from my very cursory knowledge of what the borrow checker entails, it wouldn’t add so much to Ada.
Use of pointers is already strongly discouraged by the simple fact that the language is designed to rarely truly need them. Besides, the compiler itself chooses automatically whether to pass data by value or by reference depending on the required results and what is most efficient. You can also specify parameters passed to a function as read-only. Finally, another thing that Ada does to prevent yourself shooting in your foot is to enforce strong encapsulation of functions and data.
Overall, one way to put it in simple terms is that Ada requires the programmer to give enough information to the compiler so as to ensure that it actually outputs what you want it to, which as far as I understand, is sort of what the borrow checker is there for. The downside to the Ada approach is that it is very verbose, but with the kind of code editing capabilities we have nowadays it’s certainly not as much a hassle as it was when Ada came out.
Anyways, I suspect that both languages are different enough in overall paradigm that trying to solve problems in Ada the way you would in Rust would probably be quite frustrating and give rather poor result.
Before Rust, the main argument I heard from C++ enthusiasts against Ada was that it was a nice idea but too “design-by-committee”. Which, yeah, is an ironic thing for C++ fans to say, but I guess that was enough 🤷
The main difference between C++ and D was that (for most of the time in the past) D required a garbage collector.
So, D was a language with similar Algol-style syntax targeting a completely different niche from C++.
Trying to correct your quote, it should read something like “I’m not going to switch because I can’t technically do all that stuff in D that I’m doing in C++” for it to make any sense.
“Before rust you could either have a fast language (C/C++) or a memory safe language (any other language. That is, languages with garbage collector).”
Ada managed to do safe and fast over forty years ago.
Does Ada have a capability as powerful as the borrow checker?
Strictly speaking, no. The borrow checker was a true innovation.
I’ve never used Rust but from my very cursory knowledge of what the borrow checker entails, it wouldn’t add so much to Ada.
Use of pointers is already strongly discouraged by the simple fact that the language is designed to rarely truly need them. Besides, the compiler itself chooses automatically whether to pass data by value or by reference depending on the required results and what is most efficient. You can also specify parameters passed to a function as read-only. Finally, another thing that Ada does to prevent yourself shooting in your foot is to enforce strong encapsulation of functions and data.
Overall, one way to put it in simple terms is that Ada requires the programmer to give enough information to the compiler so as to ensure that it actually outputs what you want it to, which as far as I understand, is sort of what the borrow checker is there for. The downside to the Ada approach is that it is very verbose, but with the kind of code editing capabilities we have nowadays it’s certainly not as much a hassle as it was when Ada came out.
Anyways, I suspect that both languages are different enough in overall paradigm that trying to solve problems in Ada the way you would in Rust would probably be quite frustrating and give rather poor result.
Before Rust, the main argument I heard from C++ enthusiasts against Ada was that it was a nice idea but too “design-by-committee”. Which, yeah, is an ironic thing for C++ fans to say, but I guess that was enough 🤷