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
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
| Letters | Do |
|---|---|
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 t | Pop, duplicate, swap, over, push the stack size |
k g | Give 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 u | Read 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.
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.
The factorial pushes n, n minus 1 and so on down to 1, then multiplies until one value is left.
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.
The loop does not count by itself. e1sø adds 1 to the index before ɒ compares it with the end.
Patterns it teaches
- Stack machines: two data stacks, and a third that holds where control goes next.
See also
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-languageSource
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org