See here.
First Block: Running on and integrating with desktop OSes.
- Makefile
- Comparison of failure scenarios of C and Rust
- Platform agnositc APIs in C and Rust
- Highlight of problems with glibc versions
- Quick example showing basic usage of pointers
- Quick-and-dirty example to show that rust is no magic sauce (but the compiler helps)
- The same example again but with a bit more careful error handling in place.
- Showcase of how a rust application can use an external C dependency. This was already done under the hood by the syscall example.
- We build the example with gcc
- Basic example of a C application making use of some Rust library
- We use cbindgen to generate bindings to the Rust lib to expose a C API.
- Showcase of combining
bindgen
andcc
to compile a C library and create bindigns to it for Rust. - These are two crates
generated
andgenerated_sys
to mirror the separation found in most projects
We move to a different plattform, the RaspberryPi
- The typical Hello World example used to make an LED blink
- We make use of a reaedy-made library
rppal
but encounter challenges with crosscompiling
- How does the
rppal
library make the led blink? - We poke around the library to find out that we need to set some registers
- We use
/dev/mem
to write our own code doing so - This is in preparation of a later example
- Interoperability of Java and Rust
- Small example of an integration between Java and Rust. This will be reused in the Android example
- Interoperability of C++ and Rust
- Showcase demonstrating the use of the cxx crate.
- Whilst this is more powerful than the plain C interoperability, we also see some of the limitations.
- After we learned where parts of the Rust ecosystem are located, we can make use of those present in the no_std world.
- Printing
Hello World
withno_std
but using the OS nonetheless ist ridiculous and surprisingly hard - We learn to get a feeling for no_std and its limitations but see some of Rusts beauty: The mighty features like the Ownership system can also be used in a
no_std
environment. - Since we ditched the standard library, our resulting executable is tiny