A GPIO driver in Rust
A GPIO driver in Rust
Posted Jul 20, 2021 10:54 UTC (Tue) by pbonzini (subscriber, #60935)In reply to: A GPIO driver in Rust by ras
Parent article: A GPIO driver in Rust
I agree it's not bad and definitely within noise. The languages are different enough that a precise comparison is impossible: I don't know what your tool looks like, but e.g. gpio::LineDirection::Out might be 3 or 5 tokens whereas GPIO_LINE_DIRECTION_OUT would be 1; and while C might have more "static"s, Rust might have more "mut"s.
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.
