The new Chromium class likes — like me! — to use dashes in the writing! However, I believe it should use an em-dash instead of the hyphen. Luckily this is easy: we have enabled “typographic quotes” in `mdbook`, which also handles the conversion of `---` to `—` in the generated HTML. So I normalized the single existing em-dash to a triple-dash to make it more consistent (and hopefully make it easier for translators to consistently enter these characters).
1.1 KiB
Interoperability with C++
The Rust community offers multiple options for C++/Rust interop, with new tools being developed all the time. At the moment, Chromium uses a tool called "cxx".
You describe your whole language boundary in an interface definition language (which looks a lot like Rust) and then cxx tools generate declarations for functions and types in both Rust and C++.
See the CXX tutorial for a full example of using this.
Talk through the diagram. Explain that behind the scenes, this is doing just the same as you previously did --- but by programmatically ensuring that the C++ and Rust sides match, cxx can ensure there aren't obvious errors with object lifetimes, string lengths, etc. It reduces lots of fiddly boilerplate and the resulting code feels more "natural".