3 ms·
Hum... Pure functional is a bad way to do real time I/O, but my point was about types. If you try to verify the kind of state machines that low level I/O norma
by marcosdumay 6y ago
Hum... Pure functional is a bad way to do real time I/O, but my point was about types.
If you try to verify the kind of state machines that low level I/O normally use with Haskell-like types, you will gain a huge amount of complexity and probably end with more bugs than without.
- wizzwizz4 6y agoLow-level I/O doesn't seem to have that much complexity, unless you're trying to handle all of the engineers' levels of abstraction at once. Let's say you're writing a /dev/console driver for an RS-232 connection. Trying to represent "ring indicator", "parity failure", "invalid UTF-8 sequence", "keyboard interrupt", "hup" and "buffer full" at the same level in the type system will fail abysmally, but that's not a sensible way of doing it. I could definitely implement this while leveraging the power of Rust's type system – Haskell would be a stretch, but only because it's side-effect free and I/O is pretty much all side-effects.