this post was submitted on 03 Oct 2024
39 points (86.8% liked)

Programming

17426 readers
107 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 [email protected]



founded 1 year ago
MODERATORS
 

Zig vs Rust. Which one is going to be future?

I think about pros and cons and what to choose for the second (modern) language in addition to C.

@[email protected]

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 month ago (1 children)

It's when you're at the point of saying that unsafe is safe, it's the point where you should just shut it up kid...

[–] [email protected] 1 points 1 month ago (1 children)

I don't know why you are being so rude. I thought it was the rust community that was known for being toxic?

It's not my opinion on what the unsafe keyword means. That's its purpose. Nobody ever wants to write unsafe code on purpose. The unsafe keyword was created to allow safe programs to be created in rust that wouldn't be accepted by the strict rust compilers.

In a Venn diagram, there are 2 circles: safe programs (1) and programs that are deemed safe by the rust compiler (2).

Circle 2 is smaller than circle 1 and entirely contained inside it. However, there is no reason to not let people write programs from circle 1 that aren't in circle 2. The unsafe keyword exists to enable programmers to write those programs in rust. However, it comes with a warning, now the programmer is the one responsible for making the program inside circle 1.

[–] [email protected] 1 points 1 month ago

Ok I understand now. You are right. Thank you.