In my terminal, piping sl through the Crystal portal behaves a bit differently: It only prints the first frame, then hangs until sl terminates. No further frames are printed.
Dunno what’s going wrong there. sl itself works just fine.
There seems to be some issue with the line buffering I suppose.
The Crystal implementation can be changed to IO.copy(ARGF, STDOUT) which operates without line buffering and thus is much more efficient. And more importantly, it behaves correctly.
I still have no idea what’s the difference between the Ruby and Crystal implementations though. And why my terminal only shows a single frame in the line-based implementation.
There is a difference in puts behaviour. If it needs to print a newline character, Ruby uses a single action with writev while in Crystal it’s two separate calls to write. Maybe that makes a difference.