Is Rust an officially sanctioned language at Google?
Chrome OS KVM - A component written in Rust
21–30 of 109 posts
Re: Chrome OS KVM - A component written in Rust
#22Re: Chrome OS KVM - A component written in Rust
#23Earlier quoted context omitted.
Null is not really the most pertinent example in this context - at least you get a segfault. What is more important is that in C or C++ (even C++17), it is trivially easy to produce buffer overruns, use after frees, dangling pointers, invalidated iterators, data races etc. That is the unsafety that we are talking about here. Opt-in nullability via Option is nice to have though.
Yeah, I went with familiarity/simplicity in that example. My point was similar C/C++ don't have a safe subset.
Re: Chrome OS KVM - A component written in Rust
#24Isn't stuff like that exactly counteracting Rusts raison d'etre? > // This is safe; nothing else will use or hold onto the raw sock fd. > Ok(unsafe { net::UdpSocket::from_raw_fd(sock) }) https://chromium.googlesource.com/chromiumos/platform/crosvm...
The important bit to me is that the default pointer type and the standard library don't start you out on the wrong foot.
Re: Chrome OS KVM - A component written in Rust
#25Isn't stuff like that exactly counteracting Rusts raison d'etre? > // This is safe; nothing else will use or hold onto the raw sock fd. > Ok(unsafe { net::UdpSocket::from_raw_fd(sock) }) https://chromium.googlesource.com/chromiumos/platform/crosvm...
Re: Chrome OS KVM - A component written in Rust
#26Whether you want Rust to go or, Go to rust
Go still makes network code and certain models of concurrency stupidly simple.
Rust is more of a replacement for C/C++ for me.
Re: Chrome OS KVM - A component written in Rust
#27Earlier quoted context omitted.
They should rewrite Go in Rust! That way we can avoid all this Go vs Rust discussions ;) Problem with your idea, is that low level kernel will use a lot of unsafe Rust, which will lose lot of benefits.
> Problem with your idea, is that low level kernel will use a lot of unsafe Rust, which will lose lot of benefits. I've actually worked on a toy kernel in Rust (using the excellent tutorial at https://os.phil-opp.com/ ), and it turns out that, yes, you obviously need to use unsafe code to talk to the actual hardware. But in most cases, you can encapsulate the low-level hardware inside a safe API: https://github.com/e…
Re: Chrome OS KVM - A component written in Rust
#28Earlier quoted context omitted.
> Problem with your idea, is that low level kernel will use a lot of unsafe Rust, which will lose lot of benefits. I've actually worked on a toy kernel in Rust (using the excellent tutorial at https://os.phil-opp.com/ ), and it turns out that, yes, you obviously need to use unsafe code to talk to the actual hardware. But in most cases, you can encapsulate the low-level hardware inside a safe API: https://github.com/e…
So you could do the same in C/C++, if you use unsafe it's unsafe that it's. I can't believe people arguing over unsafe used in a safe way.
Theoretically it's just all the same, but in practice having reduced interfaces does wonders to reduce the complexity and being able to reason about what brings problems, and what doesn't.
Re: Chrome OS KVM - A component written in Rust
#29Is Rust an officially sanctioned language at Google?
Since Rust is one of the most energy efficient languages and also safe, it sounds like a good fit for Google. I always wondered if they would pick it up.
Re: Chrome OS KVM - A component written in Rust
#30Earlier quoted context omitted.
Since Rust is one of the most energy efficient languages and also safe, it sounds like a good fit for Google. I always wondered if they would pick it up.
Can you expand upon what makes Rust more energy efficient than C or C++? What are the language properties that enable Rust code to be more energy optimised?