6 ms·
Is Rust an officially sanctioned language at Google?
by indy 9y ago
Is Rust an officially sanctioned language at Google?
- MrBuddyCasino 9y agoSince 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.
- Santosh83 9y agoCan 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?
- vntok 9y agoIt's not even ranked first. Rust comes a good second to third behind C & C++ on most if not all tests listed on https://sites.google.com/view/energy-efficiency-languages/results https://sites.google.com/view/energy-efficiency-languages/re...
- RodericDay 9y ago"one of the most energy efficient" + "safe"
- icebraining 9y agoIn the normalized global results, at the bottom, Rust is above C++, and closer to C than C++ is to it.
- tmzt 9y agoThis is more a reflection of where the compiler is at, not the language. As a compiled, strongly-typed language without a GC, there is no theoretical reason why Rust could not be faster than C++. As the use of MIR and HIR (two intermediate languages used within the compiler) increases more optimizations taking advantage of the memory model could be added. In the current state, much of that work is left to LLVM which is designed more around the C/C++ memory model and only some of the ownership and aliasing information can be represented in that form. I am not arguing that Rust is faster now, only that it can be without fundamentally changing the language.
- bluejekyll 9y agoI just clicked that link. Rust is in fact first on a few of those categories. I’m not sure what your point is though, as the comment says that it is “one of” the most energy efficient languages, not the most energy efficient. It appears to gernerally be in the top three. A couple of points here. Rust is generally as fast as C and C++, but on top of that it is memory and data race safe. Said another way, there is a safe language alternative which doesn’t have the pitfalls of C/C++, and that’s a great thing!
- jackmott 9y agoHe/She never said it was more energy efficient than C/C++ so...
- zaxcellent 9y agoAuthor here: Rust is not officially sanctioned at Google, but there are pockets of folks using it here. The trick with using Rust in this component was convincing my coworkers that no other language was right for job, which I believe to be the case in this instance. That being said, there was a ton of work getting Rust to play nice within the Chrome OS build environment. The Rust folks have been super helpful in answering my questions though.
- ekidd 9y ago> The trick with using Rust in this component was convincing my coworkers that no other language was right for job, which I believe to be the case in this instance. I ran into a similar use case in one of my own projects—a vobsub subtitle decoder, which parses complicated binary data, and which I someday want to run as web service. So obviously, I want to ensure that there are no vulnerabilities in my code. I wrote the code in Rust, and then I used 'cargo fuzz' to try and find vulnerabilities. After running a billion(!) fuzz iterations, I found 5 bugs (see the 'vobsub' section of the trophy case for a list https://github.com/rust-fuzz/trophy-case https://github.com/rust-fuzz/trophy-case). Happily, not one of those bugs could actually be escalated into an actual exploit. In each case, Rust's various runtime checks successfully caught the problem and turned it into a controlled panic. (In practice, this would restart the web server cleanly.) So my takeaway from this was that whenever I want a language (1) with no GC, but (2) which I can trust in a security-critical context, Rust is an excellent choice. The fact that I can statically link Linux binaries (like with Go) is a nice plus.
- Manishearth 9y ago> Happily, not one of those bugs could actually be escalated into an actual exploit. In each case, Rust's various runtime checks successfully caught the problem and turned it into a controlled panic. This has been more or less our experience with fuzzing rust code in firefox too, fwiw. Fuzzing found a lot of panics (and debug assertions / "safe" overflow assertions). In one case it actually found a bug that had been under the radar in the analogous Gecko code for around a decade.
- steveklabnik 9y ago
- kibwen 9y agoOfftopic, but I've always been a bit confused by the notion of "officially sanctioned" at Google... famously it's "Java, C++, Python, Go", but I've never heard anyone mention Javascript, which they obviously must use... or TypeScript (via Angular), or Dart (AdWords and Fuchsia), or C (Google does tons of Linux work), or ObjC/Swift (all their iOS apps). And these are only for projects we know about (if there's no Perl code running somewhere at Google, I'll eat my hat). So what does the officially-sanctioned language list determine?
- pjmlp 9y agoI would say any language on the official Google style guide web site. https://google.github.io/styleguide/ https://google.github.io/styleguide/ All the languages you mention are there.
- MrBuddyCasino 9y agoTheres Common Lisp in there! When did that happen?
- pmarin 9y agoWhen they bougth ITA Software.
- MrBuddyCasino 9y agoAh right. Forgot ITA.
- DannyBee 9y agoSpeaking as one of the folks in charge of languages: No But we also don't get in the way of teams trying to experiment and see what will work for them. (otherwise, we'd never be able to know what languages to sanction)
- bbatha 9y agoI’m on my company’s language group. Do you have any more info on what boundaries are setup for experimental usage of a language? What does the sanctioned/unsanctioned distinction provide if teams can experiment freely?
- DannyBee 9y agoThis would end up a pretty long and detailed discussion and is probably a derail. If you want to discuss it, email me :)
- myko 9y agoIt isn't sanctioned but it does look like it's gaining popularity. I've been following the xi-editor project for awhile (an editor with the backend written in Rust). https://github.com/google/xi-editor https://github.com/google/xi-editor