|
|
|
|
|
by fc417fc802
374 days ago
|
|
Yeah there's something wrong with the idea of brainfuck having character literals. The de bruijn indexing is definitely on point but the lack of continuations feels wrong to me given the stated goal. Also shouldn't the indexes be expressed as a repeated character? Like "---" would be index 3. Integer literals are decidedly non-brainfuck as well. |
|
putchar I feel kind of weird about, it acting as an identity function with a side effect is kind of weird; I'm not sure changing it to take a second argument as a continuation would make it better or worse.
Regarding the de Bruijn indices, I don't think there's a huge distinction between writing 3 vs writing ---: it would still form a single lexical token, so I feel like --- is just more noise.
Perhaps a de Bruijn index register you could move around and dereference? e.g. from index 1, index 3 is >>*, then index 2 from there is <*. But that feels less functional, because you're now imperatively manipulating some hidden state.