Alarm Clock Radio
- This esolang is a brainfuck derivative.
Alarm Clock Radio is a modified form of Brainfuck, designed to be stripped to the minimal instruction set needed to reproduce Brainfuck's functionality, except with a sleep instruction added.
Alarm Clock Radio was created by User:Deschutron one day because he couldn't find a variant of Brainfuck that has a minimal instruction set when the memory space wraps around.
An implementation was created by User:Conor O'Brien, written in ruby. It can be found here.
One of the key changes in Alarm Clock Radio is the removal of the '<' and '-' instructions, since their effects can be produced by the correct number of '>' or '+' commands. The result creates a similarity with common alarm clock radios, that often have increment buttons for their minutes and hours settings, but no corresponding decrement buttons. This similarity is responsible for the name of this language.
The instructions are summarised as follows:
> HR increments the memory pointer + MIN increments the current memory cell [ LOOP jumps past the matching ] if the cell under the pointer is 0 ] RETZ jumps back to the matching [ if the cell under the pointer is nonzero , READ reads a byte into the current memory cell . WRITE writes the byte that is in the current memory cell @ SNOOZE sleeps for the number of seconds in the current memory cell } PAD sets the memory size to the inclusive distance between the two furthest non-zero cells, plus PADSIZE cells.
where PADSIZE
is a number of memory cells.
The PAD instruction
The PAD
'}' instruction is optional, and is included for when true Turing completeness is required. PAD
allows the effective memory space to be unbounded and be cyclical.
PAD
may be used both to allocate and free memory.
Recommended memory dimensions
For the sake of consistency in implementations, the following recommendations are made:
- The recommended initial memory size with the
PAD
instruction is 60 cells. - The recommended initial memory size without
PAD
is 30000 cells, as in the original Brainfuck compiler. - The recommended value for
PADSIZE
is 60 cells. - The recommended memory cell range is 0-255, using 8 bits (1 byte)
Other suggested memory cell sizes are:
- {0, 1}, i.e. one bit per cell - for true minimalism, similar to Smallfuck.
- 0-59, for closer similarity with alarm clock radios.
Making an alarm clock
Theoretically, it is possible to write an alarm clock in Alarm Clock Radio.
It is, however, probably not possible to write an alarm clock radio in Alarm Clock Radio, because setting the alarm clock, and receiving the audio data to "play" would require two input channels.
See also
- Alarm Clock Radio/implementation.rb, an implementation of Alarm Clock Radio in Ruby
- Brainfuck, the one that started it all...
- Smallfuck, a form of Brainfuck with a reduced instruction set would be Turing-complete if it wasn't specified to have bounded memory