Section 1.6
Syntactic Efficiency of Printing Programs
An interesting problem is to determine the shortest Brainfuck code required to print out any particular provided string of characters. The code can span across any number of cells needed; thus, it is possible for the program to use multiple cells to store convenient values that are either repeated throughout the text or are slightly away from multiple character codes. There are no restrictions on how quickly the program runs, how much space it occupies, or how much sense it makes: we want only to minimize the number of Brainfuck symbols to print out the text.
We can perform a manual analysis. Assuming that we can only store across two values for simplicity, …
We can write programs in a higher-level language that experiments with Brainfuck programs and tries to find the best one.