esolang

8-Bit

Eight cells of one bit each, a pointer that can turn round, and no way to loop.

Infinitehexagon, 2023 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: 01001000

The idea

Infinitehexagon made 8-Bit in 2023, hoping for a first Turing tarpit in binary. It did not become one. The memory is eight cells of one bit, and there are no loops or jumps, so every program runs straight through once and stops. The specification calls it total and Turing incomplete.

Read the story

The pointer has a direction. > always moves it one cell, and : decides which way.

The machine

CommandDoes
fFlip the bit in the cell
vPrint the bit as 0 or 1
>Move the pointer one cell in its direction, right at the start
:Turn the direction round
iRead a bit into the cell
!Nothing

The specification leaves the edges open. This implementation wraps the pointer round from the last cell to the first, takes the characters 0 and 1 as input, and reads the end of input as 0. The specification also has an extended version by ChuckEsoteric08 with brackets and text output, a different dialect that is not implemented.

Example

The one time cat reads eight bits and prints each one back.

The one time cat reads eight bits and prints each one back.

Shift right reads four bits into the first four cells and prints them in the order 2, 3, 4, 1. It turns the pointer round three times to get there.

Expected: 1011

The Hello World uses cell 0 alone and flips it between prints, eight bits for each letter. Its first group is the H.

Expected: 01001000

The whole program is meant to print 104 bits. Its W has one v too many, so it prints 105, and every letter after the W comes out one bit late.

Expected: 010010000110010101101100011011000110111100101100001000000101011110110111101110010011011000110010000100001

The shift left has the same kind of slip. It promises 1234 as 4123 but has only three v, so it prints the bits in the order 4, 2, 3.

Further

Also in Turing tarpits

Write your own in Run Convert a program from 8-Bit

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: 8-bit.

Command line

shib run 8-bit -e 'iviviviviviviviv' --input '01001000'
shib manual 8-bit

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/8-bit.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org