The Masturbation Language For that first writing under my domain, I put on display an esoteric programming language I've made, and perhaps the only I'll ever create. Homoiconicity is required for strong metaprogramming, yet is insufficient on its own, as this will demonstrate; as I like the quality, I felt inclined to give it to an already-existing language, Brainfuck, and observe the result, in a similar vein to Brainfuck's derivation from P''. I call my result ``Masturbation'', decided by combining ``homo'' and ``fuck''. Tangentially, the other prime reason for doing this was to remove Brainfuck's ease of compilation by the means of requiring the implementation to remain for dynamic program manipulation. I was once of the opinion that a language lacking this, and so being easy to compile, was good for automation, but not much else, and would likely be uninteresting. I thought such about any language which prevented program modification during operation. I thought those which other systems found opaque were better in many ways; I've since changed mine opinion. In any case, my thinking such a program that's quite transparent to other systems tends to be simple automation of a particular task still rightly holds. The Masturbation language adds meaning to a single additional letter, the equals sign, which is used to conditionally control the homoiconic manipulation. Follows are descriptions of all the meanings: + Increment the current cell. - Decrement the current cell. > Increment the cell index modulo the data array length. < Decrement the cell index modulo the data array length. . Display the current cell as a character, likely with ASCII encoding. , Read a value into the current cell, likely as interactive character input. [ If the current cell is zero, resume after the paired ]. ] Resume at the paired [. = If the current cell is zero, the instruction array overwrites the data array; otherwise, the data array overwites the instruction array and resumes at the new first instruction. I expect the data array to be thirty thousand cells large and each cell to be an octet. There is no limit on the size of the instruction array, but it will be made to match the data array if necessary for the homoiconicity. I mulled over the lone issue of unbalanced brackets for a ways, with the two options being dynamic failure and refusal to run; the latter is so pleasant, good for all approaches to implementation, and so was chosen. This check is done whenever the instruction array is changed. Note either choice allows for controlled program exit. Follows are those only two example programs: This prints message delimited by the zero octet, shown as zero: =message0>[.>] This is a quine and was written before the homoiconic semantics were finalized: =[.>] The prime advantage of Masturbation is easily controlling the initial memory layout. This naturally adds literal data to the language by consequence, rather than fiat, and makes programs much shorter. An earlier idea for adding homoiconicity used the caret to switch between the two arrays. The prime issue with this was communication between them, and so a simpler such scheme was sought after. That circularity of the data array is for enabling storage between homoiconic operations; the instruction array must be smaller, however. An alternative mechanism could make the data array infinitely long. The only implementation is mine APL program. It features a very light debugger which traces program execution in batch. The APL is an interpreter. I considered other methods, which helped me resolve the unbalanced bracket behaviour; compilers could easily perform the check in-situ, and interpreters can easily perform the same check before any execution. It's required for compilers to maintain the instruction array for homoiconicity, but an efficient, compiled representation could also be stored. A compiler could maintain a lone stack, with opening brackets pushing locations and closing brackets popping them, with underflow or absence of the empty stack at finish indicating unbalances. I found it amusing to mull over compiling multiple instruction arrays beforehand, but this would be complex. There are several truths recognized about the language: a program lacking equals signs is equivalent to Brainfuck; an implementation could opportunistically execute future homoiconic operations, called futures; by the dual behaviour, the count of equals signs doesn't matter much, as one of two actions will occur. I called futures which become equivalent to Brainfuck ``dead ends''; I'm fairly certain determining all futures is equivalent to the Halting Problem, the hazard of finding them made clear. Remember that mulling over this language is mental Masturbation. .