esolang

靈符

Brainfuck in eight traditional Chinese characters, with a Python in the specification that swaps read and print.

PSTF, 2024 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: cat

The idea

PSTF made 靈符 in 2024. The specification says it plainly; it is a brainfuck derivative. A tape of cells and a pointer, eight commands, and each command is a traditional Chinese character in place of brainfuck's punctuation.

Read the story

The specification also gives a Python interpreter, and it disagrees with the text in one place. The text says 輸 prints and 讀 reads, and both examples are written that way. The Python does the opposite, so there its Hello, World! prints nothing. This implementation follows the text and the examples.

The machine

CharacterReadingBrainfuckDoes
移yí>Move right
靈líng<Move left
增zēng+Add 1
減jiǎn-Take 1 away
若ruò[Skip past the matching 則 if the cell is 0
則zé]Go back to the matching 若 if it is not
輸shū.Print the cell
讀dú,Read a byte

Everything else is as in the Python. The tape has 1,000,000 byte cells that wrap, a move left of the first cell reaches the last ones, as a Python list does, and 讀 gives 0 at the end of the input.

Example

The cat is ,[.,].

The cat is ,[.,]. It reads, and while the cell is not 0 it prints and reads again.

The Hello, World! runs one loop eleven times to fill six cells with 66, 99, 88, 44, 33 and 11, then walks between them. The last cell, less 1, is the line feed it ends with.

Expected: Hello, World!

Eight times eight, plus one, is 65.

Expected: A

Patterns it teaches

Further

靈符 builds on Brainfuck.

Generated by AI

Brainfuck equivalents

Write your own in Run Convert a program from 靈符

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: u9748-7b26.

Command line

shib run u9748-7b26 -e '讀若輸讀則' --input 'cat'
shib manual u9748-7b26

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/u9748-7b26.js

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

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