Brainf*ck Language EOF Design Problem

By Xah Lee. Date:

in brainfuck language, there's the issue of EOF.

what should EOF be?

and this really means, whether the system should have the capability of knowing there's no more input.

if so, then EOF should return a value. Else, it can do nothing.

if we want this capability, then we need a value for EOF. What value should it be?

then, the issue touches on user interface. That is, should we allow user to input a value of 0?

because, if we allow user to input 0, then, EOF can't take that value. So, the natural choice of EOF would be -1. (which is, not a possible value of a byte normally. This complicates brainf*ck spec.)

if we do not allow user to input 0, then, EOF can take that value of 0.

In the end, it's a design issue. There isn't a best answer. The issues are:

brainf*ck EOF design
allow UI 0no UI 0
allow EOF detectionEOF = -1EOF = 0
no EOF detectionN/AN/A

If you have a question, put $5 at patreon and message me.