User:Proxxa/Deadbeat
Designed by | User:Proxxa |
---|---|
Appeared in | Category:2025 |
Computational class | Unknown |
Reference implementation | Unimplemented |
File extension(s) | .beat |
Deadbeat is a programming language somewhat inspired by string-rewriting languages. It could be considered a Zero Instruction Set Computer because programs only define the initial state of memory, but each byte/character in memory may also be considered an instruction with the majority representing Nop.
Program Model
A program in Deadbeat describes the initial state of memory for the program. Memory is modeled as a queue of "values." A value is either a "symbol" or a "group." A symbol describes a literal character found in memory; the encoding of characters (e.g. ASCII, UTF-8, ISO 8895, etc.) is up to implementation. A group is an ordered collection of values, in essence a sub-queue of values.
When the program starts, every character in the program corresponds to a single symbol-value in the initial state of the queue. A program which contains !a&be&
contains six symbol values. There is no way to write a group; within in this page, ()
are often used when representing groups in memory, but a program which contains parenthesis will only treat them as symbols.
Once memory is initialized, the program enters a loop of popping the front symbol of the queue and performing an action based on the popped symbol. If the front of the queue is a group and not a symbol, it is unwrapped in-place (see Unwrapping).
Unwrapping
Groups may be "unwrapped" in two cases.
- The front value of the queue is a group and must be unwrapped in-place for further execution
- As part of the
+
instruction, detailed later.
Consider the queue ab(cd)e
, where (cd)
represents a group containing cd
. For now, let's consider all instructions to be Nop.
ab(cd)e
; takes a as an instruction.b(cd)e
; takes b as an instruction.(cd)e
;(cd)
is not a symbol, so it is unwrapped in-place.cde
; takes c as an instructionde
; takes d as an instructione
; takes e as an instruction- The queue is empty and the program halts.