The Epistle to the Implementors.1. Daniel Cristofani to those who implement the brainfuck language, greetings. 2. The brainfuck language is among the simplest in existence, which lulls the unwary implementor to overconfidence; for language implementation always calls for some care, and brainfuck implementation has a few wrinkles mentioned neither in the original documents of Urban Müller, nor in the excellent pages of Brian Raiter; and some issues which are mentioned there are often ignored, or perhaps the documents are not read. 3. The end of a line of text is represented differently on different platforms, and in different programming environments on the same platform. ASCII specifies only that (decimal) 10 represents a "line feed" and 13 a "carriage return", so some systems use one, some the other, some both of them together. 4. The end of input, or end-of-file (EOF), is a similar but less tractable problem. How the user conveys it depends on the environment. More importantly, there is no consensus about what to do when executing a , command after the end of input: some implementations set the cell at the pointer to 0; some set it to -1 (or the unsigned equivalent); and some leave its value unchanged. 5. Characters in brainfuck source other than the commands +,-.<>[] are comments, not errors; implementations should ignore them. 6. Extending the brainfuck language is like bolting parts to a skateboard in an attempt to build a pickup truck. Nonetheless it is a popular activity and will probably remain so. Some more interesting projects use brainfuck as a testbed for programming constructs. Others remove or combine commands, sacrificing symmetry or simplicity. At a minimum, all these efforts should be given names clearly distinct from 'brainfuck' or any euphemism for it. 7. The array should have at least 30,000 cells, if possible. 8. You might try programming in brainfuck, if you haven't. Anyway, peace be with you. -Daniel B. Cristofani (cristofdathevanetdotcom) |