this post was submitted on 21 Jul 2025
286 points (97.7% liked)
Programmer Humor
25159 readers
1570 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Relevant comment
The main difference between C++ and D was that (for most of the time in the past) D required 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.
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 🤷
Does Ada have a capability as powerful as the borrow checker?
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.
The borrow checker is a lot deeper than merely making pointer use a bit safer; it provides a model for data ownership based on affine types.
Also, to the extent 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," if I understand you correctly, that is basically true of every language with a static type system. At the extreme end, we have dependently typed languages which essentially let you express arbitrary mathematical propositions in your types and, if the program compiles, then you know that they will always be satisfied without having to do any checks at runtime.
Strictly speaking, no. The borrow checker was a true innovation.