this post was submitted on 26 Feb 2024
169 points (97.2% liked)

Programming

17492 readers
53 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

On the one side I really like c and c++ because they’re fun and have great performance; they don’t feel like your fighting the language and let me feel sort of creative in the way I do things(compared with something like Rust or Swift).

On the other hand, when weighing one’s feelings against the common good, I guess it’s not really a contest. Plus I suspect a lot of my annoyance with languages like rust stems from not being as familiar with the paradigm. What do you all think?

you are viewing a single comment's thread
view the rest of the comments
[–] sxan@midwest.social 4 points 9 months ago (1 children)

You don't have to ban C or C++; you just have to prove your programs are memory safe. It's been decades since I've coded in C, but surely Valgrind and ilk are now capable of providing reasonable proof of memory safety. You might have to turn up all the dials and set all-warnings-are-errors, but I'd be surprised if C tooling wasn't available to provide sufficient proof for a given statically-linked program.

[–] BaardFigur@lemmy.world 1 points 9 months ago (1 children)

but surely Valgrind and ilk are now capable of providing reasonable proof of memory safety

Reasonable, sure. But it's still far from being perfectly "memory safe"

[–] sxan@midwest.social 2 points 9 months ago (1 children)

Nothing, and certainly not Rust, is "perfectly" memory safe. You get closer with Haskell. At some point, you define what "good enough" is, and it's up to languages to provide tooling to either meet those standards (and be approved), or don't.

Granted, it'd be far harder for, say, Ruby to meet those proofs than a language like Rust, but the critical point is to have a defined standard of "good enough" for languages to work towards.

[–] BaardFigur@lemmy.world 2 points 9 months ago (1 children)

Nothing, and certainly not Rust, is "perfectly" memory safe.

I agree, which is one of the reasons I think it's a stupid rule to put in place, to begin with. A lot of so called memory safe languages are just built on top of C anyways (which is not considered memory safe).

Granted, it'd be far harder for, say, Ruby to meet those proofs than a language like Rust, but the critical point is to have a defined standard of "good enough" for languages to work towards.

True, but that's what the industry is already aiming for anyways. But vulnerabilities won't stop happening any time soon

[–] sxan@midwest.social 1 points 8 months ago

I want Lemmy to have reactions, so I do't have to clutter the thread just to say: 🤝