Well, to make it work without the rest of your type environment, I changed just the first couple lines of your posted code to: import posix, selectors proc readDevice(dev: string) = let devfd = posix.open(dev, posix.O_RDWR) Run
Then it compiled fine for me. I usually run a pretty fresh devel version of Nim. You may be on some earlier Nim. It's probably more useful long-term for you to learn to install a devel version of Nim than for me to test on back-dated versions.