diff options
Diffstat (limited to 'readme.md')
-rw-r--r-- | readme.md | 125 |
1 files changed, 91 insertions, 34 deletions
@@ -1,55 +1,112 @@ # Birb -| bird | term | birb | bird | -|:-----|:--------------------------|:------------|------------------| -| πͺΆ | c `[[[2 0 1]]]` | cardinal | feather | -| π¦ | i `[0]` | idiot | bird | -| ποΈ | d `[[[[3 2 (1 0)]]]]` | dove | dove | -| π€ | t `[[0 (1 1 0)]]` | turing | baby chick | -| π₯ | qβββ `[[[0 (1 2)]]]` | quacky | front baby chick | -| π£ | Ξ© `[0 0] [0 0]` | omega | hatching chick | -| π¦ | o `[[0 (1 0)]]` | owl | owl | -| π | m `[0 0]` | mockingbird | chicken | -| π¦ | k `[[1]]` | kestrel | duck | -| 𦀠| t `[[0 1]]` | thrush | dodo | -| 𦩠| y `[[1 (0 0)] [1 (0 0)]]` | sage | flamingo | -| π¦’ | s `[[[2 0 (1 0)]]]` | starling | swan | -| πͺ½ | Ο `[[[[3 (2 0) (1 0)]]]]` | phoenix | wing | -| π¦ | w `[[1 0 0]]` | warbler | turkey | -| π | f `[[[0 1 2]]]` | finch | rooster | -| π¦ | q `[[[1 (2 0)]]]` | queer | peacock | -| π¦ | b `[[[2 (1 0)]]]` | bluebird | parrot | -| π¦
| e `[[[[[4 3 (2 1 0)]]]]]` | eagle | eagle | -| π§ | ΞΉ `[0 s k]` | iota | penguin | - -The mappings and their paired reduction are *not* biologically accurate! -Unfortunately the Unicode team does not have enough bird emojis. Create -a PR to improve biological accuracy. +Birb is an *advanced* programming language that only consists of bird +emojis π£. Each emoji gets substituted by a [*combinator +bird*](https://www.angelfire.com/tx4/cus/combinator/birds.html) of pure +lambda calculus. + +## Birbs + +Unfortunately, the Unicode standard does not yet have many +(single-character) birds. These are the ones currently mapped/supported: + +| emoji | animal | combinator | bruijn | term | +|:-----:|----------------|--------------|---------------------|------------------------------------| +| π¦ | owl | owl | `[[0(10)]]` | $\lambda ab.b(ab)$ | +| π¦
| eagle | eagle | `[[[[[43(210)]]]]]` | $\lambda abcde.ab(cde)$ | +| πͺ½ | wing | phoenix | `[[[[3(20)(10)]]]]` | $\lambda abcd.a(bd)(cd)$ | +| ποΈ | dove | dove | `[[[[32(10)]]]]` | $\lambda abcd.ab(cd)$ | +| π¦ | parrot | mockingbird | `[00]` | $\lambda a.aa$ | +| π¦ | duck | quacky | `[[[0(12)]]]` | $\lambda abc.c(ba)$ | +| π€ | touring chick | turing | `[[0(110)]]` | $\lambda ab.b(aab)$ | +| π₯ | kool chick | kestrel | `[[1]]` | $\lambda ab.a$ | +| π£ | hatching chick | quirky | `[[[0(21)]]]` | $\lambda abc.c(ab)$ | +| π¦ | simple bird | identity | `[0]` | $\lambda a.a$ | +| π¦ | peacock | queer | `[[[1(20)]]]` | $\lambda abc.b(ac)$ | +| 𦀠| dodo | sage | `[[0(11)][0(11)]]` | $\lambda ab.b(aa)\lambda ab.b(aa)$ | +| π§ | penguin | blackbird | `[[[2(10)]]]` | $\lambda abc.a(bc)$ | +| π¦’ | swan | substitution | `[[[20(10)]]]` | $\lambda abc.ac(bc)$ | +| 𦩠| flamingo | cardinal | `[[[201]]]` | $\lambda abc.acb$ | + +Lonely/unmatched birbs: ππ¦π # Syntax -- `[birb]+`: Birb (left-associative) +- `[birb]+`: Birb - everything else: Comment +# Semantics + +Birbs stagger as they walk: they are reduced in alternating associative +order, starting with birb index $\lfloor\frac{\texttt{len}}{2}\rfloor$: + + π¦π¦ -> (π¦π¦) + π¦π¦π¦ -> ((π¦π¦)π¦) + π¦π¦π¦π¦ -> (π¦((π¦π¦)π¦)) + π¦π¦π¦π¦π¦ -> ((π¦((π¦π¦)π¦))π¦) + π¦π¦π¦π¦π¦π¦ -> (π¦((π¦((π¦π¦)π¦))π¦)) + π¦π¦π¦π¦π¦π¦π¦ -> ((π¦((π¦((π¦π¦)π¦))π¦))π¦) + # Examples -## Biology +You can find more examples in the `samples/` directory. + +## Relationships -- ππ $\rightsquigarrow$ π£ -- πͺΆπ¦ $\rightsquigarrow$ π¦ +- π¦π¦ $\rightsquigarrow$ π¦ - π¦’π¦ $\rightsquigarrow$ π¦ -- π¦’π¦π¦ $\rightsquigarrow$ π¦ -- π¦’π¦π¦ $\rightsquigarrow$ π -- π¦π€ $\rightsquigarrow$ π₯ -- π¦π¦ $\rightsquigarrow$ ποΈ -- π§π§ $\rightsquigarrow$ π¦ +- π§π§ $\rightsquigarrow$ ποΈ +- π¦©π§ $\rightsquigarrow$ π¦ +- π¦©π¦ $\rightsquigarrow$ π§ + +One can only imagine what happens if two parrots repeat each other: π¦π¦ +$\rightsquigarrow$ π₯ ## Arithmetic +For this example I use the Church numerals. Zero would then be encoded +as π₯π¦. The successor function can be written as π¦’π§: + +- π¦π§π¦π¦’π§π₯π¦ $\rightsquigarrow$ λλ(10) β (Church numeral 1) +- π¦π§π¦π§ποΈπ¦’π§π¦’π§π₯π¦ $\rightsquigarrow$ λλ(1(10)) β (Church numeral + 2) + +Similarly, one can very obviously translate the Church addition function +to π§π¦’π₯π¦’ποΈ. Now, to calculate $1+2$ based on their increments from +zero: + +- π¦’π§π¦’π§π₯π¦ + +Also: π§ is $a\cdot b$, π¦ is $n^n$ and π¦π¦ $a^b$. + +Note that there are many alternative ways to do arithmetic. Try writing +the functions above with other birbs! + ## Busy ~~beavers~~ birbs +- The touring eagle: π¦π¦π¦π¦
π€π¦
π€π¦
π€ (~20M BLC bits) +- more? PR! + +# Usage + +Install [Haskellβs +stack](https://docs.haskellstack.org/en/stable/install_and_upgrade/). +Then, + +- `stack run -- file.birb` or `stack run <(echo π§π§)` +- `stack install` so you can enjoy `birb` from anywhere + +If the output cannot be translated to birbs, the raw lambda calculus +term (with De Bruijn indices) is printed. For the examples above I +sometimes manually converted the term back to birbs. + # Turing-completeness The language is probably Turing complete. If the language supported left- *and* right-associativity, π§ would be enough to prove its completeness. + +------------------------------------------------------------------------ + +The idea of the language was originally proposed in 2021 by an +unknown(?) author on [Esolang](https://esolangs.org/wiki/Birb). |