google / comprehensive-rust

This is the Rust course used by the Android team at Google. It provides you the material to quickly teach Rust.
https://google.github.io/comprehensive-rust/
Apache License 2.0
27.65k stars 1.65k forks source link

Worth keeping android/interoperability/cpp.html and chromium/interoperability-with-cpp.html in sync? #1523

Open anforowicz opened 10 months ago

anforowicz commented 10 months ago

Android-specific and Chromium-specific parts of the course both talk about using https://cxx.rs for C++/Rust interop. Is it worth it to somehow unify some of the content?

In particular, both introductory slides (at android/interoperability/cpp.html and chromium/interoperability-with-cpp.html) have a diagram of how cxx works, but Chromium also has additional speaker notes where it lists some benefits (over manually authoring the bindings).

PS. Some of the content will need to remain Android-specific and/or Chromium-specific:

/cc @adetaylor

mgeisler commented 10 months ago

Great that you're on top of this!

I agree that there will be

I've been thinking of pulling all of the "Interoperate with X" slides out of the Android section and putting them into their own top-level place for a while. They're a bit out of place there, honestly.

Now, the question is how we can do this? I don't like duplicating the slides, but I think this approach could work:

I think this could work reasonably well — it will be like those Choose Your Own Adventure books I remember from when I was a child :smile: An important advantage of this is that the mdbook search will point you to the right place since the generic content is only present once.

The Android/Chromium slide could have the part about build rules before after the link to the generic CXX slides.

/cc @randomPoison and @fw-immunant

djmitche commented 10 months ago

We could consider putting that after the unsafe section of the Fundamentals course. I've left a fair bit of time for that section, but after some experience teaching the course maybe there's room?

mgeisler commented 4 weeks ago

Hi @anforowicz, would you be able to do the merge of the slides?

I've noticed that I often end up on the wrong slide when I search for "cxx" — that is, I end up on, say, Limitations of CXX instead of With C++ which covers CXX in detail.

The detailed coverage was added in #1392 by @randomPoison and I think it would be helpful to combine this. As Dustin suggests, it would fit nicely into the Unsafe Rust section.

The Android and Chromium classes could then just link to this section — we don't have to go linearly through the large book when teaching a class :-)

anforowicz commented 3 weeks ago

Hi @anforowicz, would you be able to do the merge of the slides?

I'll try to take a look, but it may take me a while to get here.

mgeisler commented 2 weeks ago

I'll try to take a look, but it may take me a while to get here.

That is totally fine, as long as it's someones radar :smile: Thanks!