Qdeql

From Esolang

Jump to: navigation, search

Qdeql is a language that provides a single byte queue as the only form of memory available to programs.

Contents

[edit] Instructions

= NEXT   Dequeue a byte and enqueue it again
- DEC    Dequeue a byte, subtract one (wrapping around), and enqueue it
\ BEGIN  Dequeue a byte and skip to the instruction after the
         corresponding END if the byte is zero; otherwise, enqueue the
         byte again, followed by two zero bytes
/ END    Go back to the corresponding BEGIN
& INPUT  Read a byte from stdin and enqueue it (0 for EOF)
* OUTPUT Dequeue a byte and write it to stdout

If the queue is empty, any instruction that would normally use a value from the queue instead uses 0.

[edit] Computational capability

To be able to access arbitrary amounts of data in a Qdeql program would require storing that data in the queue. But accessing any particular byte more than once requires knowing how many bytes are in the queue, and to determine this would require accessing a particular byte more than once. Therefore, it is not possible to access arbitrary amounts of data in a Qdeql program.

This puts Qdeql into a situation similar to SMETANA's, where the amount of memory a program can use is limited by the size of the program.

[edit] See also

  • Sceql, a revised version of Qdeql. Considerably more practical and easy to program in than Qdeql.

[edit] External resources

Personal tools