• 0 Posts
  • 8 Comments
Joined 5 months ago
cake
Cake day: March 4th, 2025

help-circle
  • 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.