40
all 50 comments
sorted by: hot top controversial new old
[-] SorteKanin@feddit.dk 8 points 8 months ago

How do you succinctly call a language that has all behavior defined or equivalently no undefined behavior (aside from designated regions)? "Memory safety" is nice since it's concise. Is there another term? Maybe just a "safe" language?

[-] sugar_in_your_tea@sh.itjust.works 12 points 8 months ago

Wouldn't that language be called "sound"? A "sound" language would guarantee no errors or surprises in types, memory access, or statement execution. It would need to be qualified though since it didn't guarantee programs are sound (that implies error free), it only guarantees use of the language is sound.

"Safe" language also works, and is probably more understandable by the nontechnical decision makers, though it also needs a qualifier to understand what that means.

"Memory safe" is clear and explains one of the huge areas that it excels at. I would prefer "zero cost memory safety" myself, since that sets it apart from other memory safe languages that have extra costs (e.g. runtime checks). "Zero cost safety" is also fine, though I'd want an asterisk that clarifies what it applies to: memory, typing, and statement execution safety.

[-] SorteKanin@feddit.dk 8 points 8 months ago

Zero cost soundness, I like it haha

[-] ferralcat@monyet.cc 5 points 8 months ago

Ive never gotten to write rust professionally, but I have always kinda winder d if it was marketed wrong. My thought was always that it should be sold as "easy" though. Its easy to write code. It's hard(er) to make mistakes.

I kinda figure there's a bunch of systems programmers with their heads up their asses who would never be caught dead writing in an "easy" language though, so it couldn't go that way.

(I got bored and started skimming halfway though this article, but it's neat to hear about up and coming languages I'll never use at the end)

[-] sugar_in_your_tea@sh.itjust.works 2 points 8 months ago

But it's not easy. Understanding how memory works isn't easy, and satisfying the borrow checker is even harder. There are quite a few things that the borrow checker rejects that are completely fine, so you also may need to relearn some idioms.

Perhaps it would be better to market it as encouraging "sustainable" code. By that I mean:

  • lower chance of introducing concurrency bugs if you stick to safe rust
  • smother, safer refactors due to the type system and borrow checker
  • better long term performance because memory related performance issues are more obvious
  • strong nudge toward smaller structures because a lack of inheritance makes massive structures more of a pain to deal with

And so on. It encourages a more sustainable codebase, though you'll pay for that upfront.

[-] lysdexic@programming.dev 1 points 8 months ago

Ive never gotten to write rust professionally, but I have always kinda winder d if it was marketed wrong. My thought was always that it should be sold as “easy” though. Its easy to write code. It’s hard(er) to make mistakes.

I agree, but I don't think the problem is marketing. The problem is how some elements of Rust's community desperately try to upsell the language beyond the value it actually can provide, and once that fails they fall back to toxic behavior and basically just mindlessly shitting on anything that's not Rust. It goes well beyond a cargo cult mentality, and it's sad that a fine technology is dragged through the mud by those who were expected to show its value.

[-] Ephera@lemmy.ml 4 points 8 months ago

I like to talk of 'correctness' (as in the objective quality) and 'rigidity' (subjective; generally better for larger programs and programs that need to be correct, but potentially worse for prototyping and flexibility).

Ultimately, what I care about as a programmer is, if I write/refactor/tweak some code in this language, how many weird edge-cases are ruled out or handled for me? How many unit tests do I have to write, to ensure this myself?

Python is relatively bad at that, even though it's technically memory-safe, as the post mentions. The dynamic typing, for example, means some refactoring mistakes will just not show, unless you've got close to 100% integration test coverage.

So, yeah, I feel like this whole "memory safety" buzzword is lost on pretty much everyone working in a garbage-collected language, even though many of them would be extremely glad about a more correct and/or more rigid language.

[-] noctisatrae@beehaw.org 4 points 8 months ago

TL;DR Linkedin clickbait

I did read the article and it’s maybe it’s just me being a bitter, spiteful & petulant being, obnoxious to talk with but this article sucked. Every point ranged hollow.

It was really bad because the author in his 11y of writing Rust never once heard about the philosophy of Rust/Unsafe Rust.

The goal of MSLs is to reduce UB, and Rust want to do that but keep the speed and the productivity.

Of course, at some point you may need some C/C++ because it’s the cornerstone of modern programming but what you are calling with FFI are audited, open-source libraries so memory leaks/undefined behaviour is minimised.

  • Rust is implemented in Rust so FFI is greatly minimised if we follow the logic of the blogger.
[-] BatmanAoD@programming.dev 6 points 8 months ago

the author in his 11y of writing Rust never once heard about the philosophy of Rust/Unsafe Rust.

Are you...aware of who the author is? He literally co-wrote The Book, aka The Rust Programming Language.

[-] lysdexic@programming.dev 4 points 8 months ago

It was really bad because the author in his 11y of writing Rust never once heard about the philosophy of Rust/Unsafe Rust.

You're talking about Steve Klabnik, a guy known for being one of the authors of The Rust Programming Language and the guy who literally ran the @rustlang Twitter account.

[-] noctisatrae@beehaw.org 1 points 8 months ago

Doesn’t change the overall quality of the article ?

[-] lysdexic@programming.dev 2 points 8 months ago

Doesn’t change the overall quality of the article ?

I'm sorry, but I'm afraid the article is quite good.

[-] noctisatrae@beehaw.org 1 points 8 months ago

Why? I’m eager to learn.

this post was submitted on 24 Dec 2023
40 points (85.7% liked)

Rust

5744 readers
82 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS