←back to thread

171 points g0xA52A2A | 2 comments | | HN request time: 0.428s | 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 #
nicce ◴[] No.41869321[source]
It is manager, not runner. Does it require that much unsafe?
replies(1): >>41870291 #
gpm ◴[] No.41870291[source]
Out of 413,842 non-empty lines of rust code in the repository (including comments) there are 2006 instances of "unsafe", 255 of which are of the form "unsafe_" (definitely not unsafe blocks, mostly of the form #![forbid(unsafe_code)] which is an instruction to the linter to forbid unsafe blocks in the module) leaving slightly less than 1751 unsafe blocks. (Still counting comments, and type signature annotations on function pointers, and so on, but most of those 1751 will be actual unsafe blocks. A block can of course be multiple lines of code).

I don't really know what a VMM consists of, so I'm mostly surprised that this project is half a million lines of code.

replies(1): >>41870957 #
1. estebank ◴[] No.41870957[source]
For this kind of analysis, https://github.com/geiger-rs/cargo-geiger comes in handy.
replies(1): >>41871160 #
2. gpm ◴[] No.41871160[source]
Yeah, I tried that before resorting to just using `rg`, unfortunately this issue prevents it from working: https://github.com/geiger-rs/cargo-geiger/issues/523