HackerTrans
TopNewTrendsCommentsPastAskShowJobs

mrtngslr

no profile record

Submissions

Rust in Chromium

google.github.io
9 points·by mrtngslr·hace 3 años·1 comments

Scaling Rust Adoption Through Training

security.googleblog.com
9 points·by mrtngslr·hace 3 años·2 comments

comments

mrtngslr
·hace 3 años·discuss
The family of Rust courses by Google have grown to include a course on how to use Rust in Chromium!

This is targeted at Chromium engineers and others who build the browser, but everybody can play along at home and learn how to integrate Rust with their browser.

The goal is to make Chromium and Chrome more secure by eliminating a whole class of errors related to unsafe memory handling.
mrtngslr
·hace 3 años·discuss
Thanks! We do include speaker notes on some pages (but not yet all[1]). We would love to expand this and PRs are very welcome for this :-)

I think videos will end up being made by someone other than me since I feel it takes too much effort when you don't have the right setup already. We have an issue and I'll update it as soon as I hear more about videos.[2]

[1]: https://github.com/google/comprehensive-rust/issues/1083 [2]: https://github.com/google/comprehensive-rust/issues/52
mrtngslr
·hace 3 años·discuss
A bit more detail: we've been expanding our Rust training at Google over the last year. We've now had more than 500 Googlers go through Comprehensive Rust and they tell us that they really like it — also when we ask them again three months later :-)

The post is a huge Thank You! to the many people who have helped with the course, both inside and outside of Google. More than 30 Googlers (who already knew Rust) have picked up the course and taught it around the world.

People have used the material for university classes[1] and there will soon be online classes[2] as well. I hope it will become a good resource for people to teach Rust in many different contexts!

Pull requests are always welcome, the whole thing is open source[3]!

[1]: https://mo8it.com/blog/teaching-rust/

[2]: https://twitter.com/mrtngslr/status/1696601520412783052

[3]: https://github.com/google/comprehensive-rust/
mrtngslr
·hace 3 años·discuss
I wrote a blog post about how we've been scaling Rust adaption in Google.
mrtngslr
·hace 3 años·discuss
I've seen that too: having experience with Rust made C++ feel easy.

I looked at C++ many years ago but never used it professionally. About 6-7 years ago, I learnt Rust and a few years later, I started working full time in a C++ team at Google. There are many things in the Google C++ Style Guide[1] that reminds me of Rust, from the ban on exceptions to the use of `std::optional` for optional inputs and outputs.

[1]: https://google.github.io/styleguide/cppguide.html
mrtngslr
·hace 3 años·discuss
Hey there! I wrote the course and you're spot on: the course is meant for classroom training (at Google and elsewhere). If you have the time to read a book, then I highly recommend diving into one of the many great Rust books. I've linked some of the freely available ones here: https://google.github.io/comprehensive-rust/other-resources.....

We've made an attempt at making Comprehensive Rust useful for self-learners by providing speaker notes on many of the pages. However, they're still quite terse and could be expanded in many places. PRs for that will be gratefully accepted :-)
mrtngslr
·hace 3 años·discuss
My colleguage Andrew wrote the bare-metal part. I believe he picked the micro:bit board because it's readily available around the world. It also has a lot of fun sensors (microphone, rudimentary speaker, compass, ...). I'm sure there are other boards around, but so far people seem very happy with this board in our classroom training.

The only slight problem is the noise when 30 boards are powered on at once :-D They ship with an elaborate demo program which plays sounds and blinks the LEDs when you start it up.
mrtngslr
·hace 4 años·discuss
Yes, it's definitely important to tailor the training to the audience!

When I'm teaching the course, I start by asking people about their background — if it's primarily C/C++ people, then we can quickly page through the slides about the stack and the heap.
mrtngslr
·hace 4 años·discuss
The course is meant to be interactive, which means that you should try out the embedded code snippets. You can edit them and run them from your browser :) However, if you really want a PDF, then use the print page[1]. It will let you produce a ~210 page PDF with the entire course.

For learning Rust via a non-interactive medium, I recommend the Rust Book[2]. It has all the narrative that the course material is missing.

[1]: https://google.github.io/comprehensive-rust/print.html

[2]: https://doc.rust-lang.org/book/.
mrtngslr
·hace 4 años·discuss
Thanks for posting the link and thank you very much to everyone who have sent us PRs over the last 24 hours!

Please keep submitting them. You can use the little pencil icon in the top-right of any page to quickly submit a typo fix patch. I'm from Denmark and English is not my first language — I very much appreciate the help from you to fix all the grammar mistakes :-)
mrtngslr
·hace 4 años·discuss
Yeah, that is a fun tutorial indeed :-D I forgot to add that one to the list of https://google.github.io/comprehensive-rust/other-resources..... Would you care to open a PR for that?
mrtngslr
·hace 4 años·discuss
Sorry, you're right :-) I meant to comment further up where people asked if we could reference rustup.rs in the installation instructions.
mrtngslr
·hace 4 años·discuss
I actually haven't tried this... do you know off the top of your head what it takes to make a cycle with Rc?

It should not be possible with normal borrows (and safe Rust) since they're statically checked to be acyclic.
mrtngslr
·hace 4 años·discuss
Right, this is a problem with reference counted data structures in general. You're correct that Rust doesn't try to solve this particular problem.

Put differently, the borrow checker won't allow you to create a cycle of refrences (the & kind). But you can do it with library types such as Rc.
mrtngslr
·hace 4 años·discuss
Thanks for reposting :-)

In general, I feel that the new course will be useful for people who want to teach Rust. If you have a group of engineers and you want to teach them Rust, then this is a ready-to-go solution. You only need to spend some time getting familiar with the material and then you can start teaching it. I don't think there was such a resource before.

For self-study, I really like the Rust book and also Rust by Example. I've listed a bunch of good resources here: https://google.github.io/comprehensive-rust/other-resources.....
mrtngslr
·hace 4 años·discuss
Hi, I wrote the new course. We have been enabling the use of Rust in the Android Platform.

Roughly speaking, the Android Platform is the Linux distribution running below the Android apps we all know. There are a number of daemons running on the system and these are often written in C++. We've now made it possible for Android engineers to write them in Rust instead (or to link in Rust libraries if they want). To do this, the Android build system had to be extended with new rules, see https://source.android.com/docs/setup/build/rust/building-ru....

The overall goal is to have more secure software. Rust removes a whole class of possible security vulnerabilities and we deploy it to make phones more secure. See https://security.googleblog.com/2022/12/memory-safe-language... for details on that.
mrtngslr
·hace 4 años·discuss
Actually, there is already an issue for this: https://github.com/google/comprehensive-rust/issues/19 and I hope someone will fix it soon :-)
mrtngslr
·hace 4 años·discuss
To be honest, the course suggests using apt since that's an easy security-approved way to install things on our computers (see https://en.wikipedia.org/wiki/GLinux).

I'll be happy to update it to suggest using rustup like "normal". Could you make a PR for that?
mrtngslr
·hace 4 años·discuss
Hi, I wrote the course :-) Yes, this is a real thing — Android has had support for Rust in the Android Platform for a few years now. Most recently, we shipped support for DNS-over-HTTP/3: https://security.googleblog.com/2022/07/dns-over-http3-in-an...

We put out the course to make it easy for even more people to onboard with Rust.