Bolic
Four variables, a loop and a branch, all spelled in dingbats.
Yutaka Hara, 2008 · Turing complete: unknown · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Yutaka Hara designed Bolic in 2008 as an example for his book on building strange languages in Ruby, Rubyで作る奇妙なプログラミング言語. Underneath it is an ordinary small language with four variables, arithmetic, an if and a while. Only the spelling is odd. The numbers are the circled ⓪ to ⑩, the variables are four stars, and the keywords are a musical note, a writing hand, a recycling sign, two pointing hands, a chess knight, a plane and three faces.
Read the story
The if is an expression, so it can stand on the right of an assignment, and a block has the value of its last statement. There is output but no input.
The machine
| Symbol | Does |
|---|---|
⓪ to ⑩ | The numbers 0 to 10 |
✪ ✩ ✷ ✲ | The four variables |
V ☜ e | Assign e, and give its value |
+ - × ÷ | Arithmetic |
♪ e | Print e as a character |
✍ e | Print e as a number |
♺ e ☞ ... ♘ | Loop while e is not 0 |
✈ e ☺ ... ☹ ... ☻ | If, with an optional else |
The grammar puts a whole expression to the right of + and -, so they group from the right. The specification's prose says ♪ prints a number and ✍ a character, but both of its programs use them the other way round, and so does this implementation.
Example
The Hello, world! program builds every letter from ⑩ at most.
The Hello, world! program builds every letter from ⑩ at most. H is ⑦×⑩+②, 72.
The ten Fibonacci numbers count ✪ down from 10 and print each number and a line feed, ♪⑩.
Grouping from the right makes 7 - 2 - 1 come out as 7 - (2 - 1), and an if gives the value of its branch.
Further
See also
Also in Jokes
Write your own in Run Convert a program from Bolic
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: bolic.
Command line
shib run bolic -e '✪☜⑩
✷☜ ⓪ ✲☜①
♺ ✪ ☞
✩☜ ✷+ ✲
✍ ✩♪⑩
✷☜ ✲ ✲☜ ✩
✪☜ ✪−①
♘'shib manual bolicSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/bolic.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org