User:Proxxa/Deadbeat

From Esolang
Jump to navigation Jump to search
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.

  1. The front value of the queue is a group and must be unwrapped in-place for further execution
  2. 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.

  1. ab(cd)e; takes a as an instruction.
  2. b(cd)e; takes b as an instruction.
  3. (cd)e; (cd) is not a symbol, so it is unwrapped in-place.
  4. cde; takes c as an instruction
  5. de; takes d as an instruction
  6. e; takes e as an instruction
  7. The queue is empty and the program halts.