I believe what you are running into is this terminal driver issue:
> [http://unix.stackexchange.com/questions/131105/how-to-read-over-4k-input-without-new-lines-on-a-terminal](http://unix.stackexchange.com/questions/131105/how-to-read-over-4k-input-without-new-lines-on-a-terminal)
I wasn't aware of this kind of limitation with standard input. Perhaps you can
find some clues about how to fix this by having a look at the source code of
[pv](http://www.ivarch.com/programs/pv.shtml). I often use it to process data
read through stdin, and I have never encountered problems with
I think you're right - this is not a bug with Nim, but something to do with the
buffer size for STDIN. You could try wrapping setvbuf and setting options on
STDIN buffer size that way? maybe?
I get the same behavior with the Python script
from sys import stdin, stdout
inpu
Is it something related to stdin's default buffer size? Default is around 4096
character IIRC.
I think it's running into a problem when the line length is greater than
BufSize - in your example above, the equation is a little > 4000 chars long,
and
[readAllBuffer](https://github.com/nim-lang/Nim/blob/master/lib/system/sysio.nim#L171)
is ultimately what's called.
I don't see obvious bugs
When I ran a debug build, I got this stack of errors:
Traceback (most recent call last)
random_art.nim(185) random_art
equationParser.nim(51) parseEquation
equationParser.nim(73) buildEquation
ModExpr.nim(72) buildMod
equationParser.nim(75) buil
I don't have the crash report. In the stack trace there might be information
that helps to solve this problem.