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

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] m_f@discuss.online 58 points 2 days ago (25 children)

Relevant comment

I don't use Rust much, but I agree with the thrust of the article. However, I do think that the borrowchecker is the only reason Rust actually caught on. In my opinion, it's really hard for a new language to succeed unless you can point to something and say "You literally can't do this in your language"

Without something like that, I think it just would have been impossible for Rust to gain enough momentum, and also attract the sort of people that made its culture what it is.

Otherwise, IMO Rust would have ended up just like D, a language that few people have ever used, but most people who have heard of it will say "apparently it's a better safer C++, but I'm not going to switch because I can technically do all that stuff in C++"

[–] soc@programming.dev 7 points 2 days ago (1 children)

“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 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.

[–] adb@lemmy.ml 4 points 2 days ago (2 children)

“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.

[–] BatmanAoD@programming.dev 5 points 1 day 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 🤷

[–] bitcrafter@programming.dev 1 points 1 day ago (2 children)

Does Ada have a capability as powerful as the borrow checker?

[–] adb@lemmy.ml 1 points 1 day ago (1 children)

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.

[–] bitcrafter@programming.dev 1 points 19 hours ago

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.

[–] BatmanAoD@programming.dev 2 points 1 day ago

Strictly speaking, no. The borrow checker was a true innovation.

load more comments (23 replies)