> Guo joked that the best way to learn Rust was to learn C++, hate it, and then learn Rust.
> Guo joked that the best way to learn Rust was to learn C++, hate it, and then learn Rust.
Posted Sep 23, 2024 16:25 UTC (Mon) by adobriyan (subscriber, #30858)Parent article: Resources for learning Rust for kernel development
The easiest way to start hating Rust is to implement something with OsString, keep them around (so you can't use String goodies) and pass them to external C string-accepting library (so it must be CString in the end).
It can be quite paternalistic language. Expect culture shock here.
> why the hell was there no unlock
This is so true. In C++ one would write
{
auto _ = std::lock_guard{obj->mutex};
...
}
which hides unlock which takes time to get used to.
Kernel being kernel with 8 spaces per tab doesn't help so this additional indent level may trigger checkpatch.pl alarms.
