brain icon indicating copy to clipboard operation
brain copied to clipboard

Implement stdin.read_exact() to specification

Open sunjay opened this issue 8 years ago • 0 comments

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_unchecked which 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
  • [ ] Consider whether this is needed when reading just a single byte at a time (see cat.brn)

sunjay avatar Apr 17 '17 03:04 sunjay