esolang

International Phonetic Esoteric Language

A stack language spelled in the International Phonetic Alphabet, where the voicing of a consonant picks the stack.

Bigyihsuan, 2020 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello, World!

The idea

Bigyihsuan made IPEL in 2020. Every instruction is one letter of the IPA, and the letters are grouped the way phoneticians group sounds. Bilabials choose a stack, plosives move values around, central vowels compare, front fricatives do arithmetic, back fricatives work on strings and the close vowels read and print.

Read the story

There are two data stacks, called unvoiced and voiced, and a register. A third stack, the execution stack, holds loop counters and the places that functions return to. A program can read and overwrite those places, so a function can decide where it returns.

The machine

LettersDo
0 to 9 {12} {1.5} "text"Push a number or a string
ɸ β ɓUse the unvoiced or the voiced stack; push which one is in use
p b d q tPop, duplicate, swap, over, push the stack size
k gGive the top to the other stack; take the other stack's top
ɨ ʉ ə ɘ ɵCompare with greater, at least, equal, less, at most, giving 1 or 0
s z f v ⱱ ʃAdd, subtract, multiply, divide, modulo, power
x ħ χ ʁJoin as strings, length, number to character, string to numbers
i o uRead a line; print with a line feed; print without one
|l| ɔ|l| ʌA label; jump to it; pop and skip the next instruction if true
<f>/ ... \ <f>Define a function; call it
ɑ ... ɒ e øA loop from a start to an end; read or set its index

Numbers behave as in Python, whose escapes, ord() and log(a, b) the specification names. Whole numbers have no bound, v always gives a float, and a float prints as Python prints it, so 6 divided by 2 is 3.0.

This implementation leaves out lists, the third type, because the specification does not say how they print or convert.

Example

The Fibonacci function, called on 10.
Expected: cat
Expected: 3.0 1267650600228229401496703205376

The Fibonacci function, called on 10. It returns at |end| when n is at most 1, and otherwise calls itself on n minus 1 and n minus 2 and adds the two.

Expected: 55

The factorial pushes n, n minus 1 and so on down to 1, then multiplies until one value is left.

Expected: 120

A call pushes the index of the next instruction onto the execution stack. Inside f, e2sø adds 2 to it, so the function returns past "No" and o.

Expected: Yes Skipped no

The loop does not count by itself. e1sø adds 1 to the index before ɒ compares it with the end.

Expected: 1 2 3 4 5 6 7 8 9

Patterns it teaches

  • Stack machines: two data stacks, and a third that holds where control goes next.

Further

Stack-based

Write your own in Run Convert a program from International Phonetic Esoteric Language

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: international-phonetic-esoteric-language.

Command line

shib run international-phonetic-esoteric-language -e 'io' --input 'Hello, cat!
'
shib manual international-phonetic-esoteric-language

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/international-phonetic-esoteric-language.js

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

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