←back to thread

171 points g0xA52A2A | 1 comments | | HN request time: 0.204s | source
Show context
low_tech_love ◴[] No.41867927[source]
I find it interesting that every single piece of software that was ever written in Rust always mentions that very proudly in its title. It's not something I see often with other programming languages (most software is just software and doesn't necessarily advertise the language it was built with). I do not know anything about Rust, so I'm just curious, does this confer a kind of underlying trustworthiness or quality to the application?
replies(23): >>41867986 #>>41867995 #>>41868011 #>>41868016 #>>41868179 #>>41868202 #>>41868225 #>>41868314 #>>41868501 #>>41868526 #>>41868534 #>>41868587 #>>41868610 #>>41869045 #>>41869046 #>>41869095 #>>41869111 #>>41869302 #>>41869373 #>>41869409 #>>41869596 #>>41869606 #>>41869834 #
sirwhinesalot ◴[] No.41867995[source]
Due to Rust's safety guarantees there's a perception that software written in Rust is automatically safer than software written in its direct competitors C and C++.

This is not necessarily true, you can write unsafe Rust code and you can write safe C++ code, but it does seem to hold in practice that the guardrails imposed by Rust help quite a bit in stopping devs from making really stupid mistakes.

That would be the "thrustworthiness" implied by the use of Rust.

replies(2): >>41869017 #>>41871340 #
bitexploder ◴[] No.41869017[source]
And a VMM is going to require a lot of unsafe rust code. There are strategies to minimize it to make that surface easier to audit, but it is not a panacea for systems programming gremlins.
replies(4): >>41869197 #>>41869220 #>>41869321 #>>41869496 #
Ygg2 ◴[] No.41869496[source]
It's not unsafe that causes unsafety, it's how you wield it.

- Do you know your invariants?

- Have you documented them?

- If using unsafe block, have you asserted them or guaranteed that they hold for any input?

Granted, Rust is kind of mediocre at teaching you this. It raises warning for unsafe fn without safety documentation block, but not when omittin safety comments in unsafe blocks.

replies(1): >>41870384 #
1. gpm ◴[] No.41870384[source]
For what it's worth, clippy has an optional lint to detect undocumented unsafe blocks: https://rust-lang.github.io/rust-clippy/master/index.html#un...

Edit: And it turns out it's enabled as a warning in this repo.