esolang

Base2e15text

Seven Chinese and Korean characters that say Hello, world!

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

Tested with 2 known programs · Test method

Run it

Expected: Hello, world!

The idea

PSTF designed Base2e15text in 2024. It is Text, in which a program is printed as it is, but written in base2e15, an encoding made by a web tool linked in the specification. Every character holds 15 bits. Seven characters hold the 13 bytes of Hello, world!, which take 18 in Base64 without padding.

Read the story

The specification says only that the language is Text encoded by the tool. This implementation decodes the program, as the tool does, and prints what it says.

The machine

The 15 bit values sit in three blocks of Unicode, and a short last character has a block of its own.

CharactersHold
U+3480 to U+4DB50 to 6453
U+4E00 to U+89256454 to 21595
U+AC00 to U+D7A321596 to 32767
U+3400 to U+347F7 bits, for a last character

The bits are read high bit first and cut into bytes, and bits left over at the end are dropped. The examples use only the first three blocks. The 7 bit block is the gap of 128 characters they leave below U+3480. Any other character, a line break too, is passed over.

The 99 bottles of beer and FizzBuzz programs decode to 508 and 135 bytes that are not UTF-8 text. The tool packs longer texts in some way the specification does not give, so this implementation stops with an error on them, as on any program whose bytes are not text.

Example

The second is the XKCD random number.
Expected: 4

The second is the XKCD random number. 今 is U+4ECA, which holds 6656, or 001101000000000 in 15 bits. The first eight bits are 00110100, the digit 4, and the last seven are padding.

Patterns it teaches

  • Encoding tricks: 15 bits in one character, taken from three blocks of Unicode.

Further

Also in Jokes

Write your own in Run Convert a program from Base2e15text

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: base2e15text.

Command line

shib run base2e15text -e '今'
shib manual base2e15text

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/base2e15text.js

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

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