A GPIO driver in Rust
A GPIO driver in Rust
Posted Jul 20, 2021 10:12 UTC (Tue) by ras (subscriber, #33059)In reply to: A GPIO driver in Rust by bredelings
Parent article: A GPIO driver in Rust
Using vim as a very rough tool to break the code into tokens yields: C = 2134 tokens, Rust = 2261 tokens.
I expected Rust to be higher than C. Putting all that type information on each line comes at a cost. I am somewhat surprised the cost is so only 6%. It might even be within the error margin of my rough tool.
Posted Jul 20, 2021 10:54 UTC (Tue)
by pbonzini (subscriber, #60935)
[Link]
The thing that surprises me the most is how different it looks from C. For example I couldn't follow how the irqchip can be used from C code, all I could see is an implementation of irq::Chip.
That on one hand means that the bindings are idiomatic, on the other hand it means the Linux code base would be split in two even more than I expected.
A GPIO driver in Rust
