brain
brain copied to clipboard
Implement stdin.read_exact() to specification
The current instruction generation for stdin.read_exact() is not exactly what was described in https://github.com/brain-lang/brain/issues/66.
- [ ] Implement the full, exception safe version of reading input (branching on whether a read returned null or not)
- [ ] Put this behind a compiler flag since it may be desirable to turn it off
- Alternatively, add an unsafe method called
stdin.read_exact_uncheckedwhich reads the bytes without checking if each one is zero - Another alterative is to have a method for reading a single byte that is unchecked, probably makes more sense this way
- Alternatively, add an unsafe method called
- [ ] Consider whether this is needed when reading just a single byte at a time (see cat.brn)