## ~rabbits/yo-joy

Combinatory logic playground, written in Tal
`Minor optimizations`
`Added makefile`
`Format`

master
browse  log

### clone

https://git.sr.ht/~rabbits/yo-joy
git@git.sr.ht:~rabbits/yo-joy

You can also use your local clone with git send-email.

## #Yo!Joy

Yo!Joy is a reversible programming language taking its primitives from Henry G. Baker's psi-lisp and Brent Kerby's concatenative combinators. It's not quite a htro-forth, but a stack machine made of cons cells or the reverse image of a linear lisp.

### #Manual

#### #psi-lisp

Lossless.

• `minus ( t -- -t )`.
• `not ( t -- ~t)`.
• `xor ( n t -- n t^n )`
• `swp ( n t -- t n )`
• `inc ( n t -- n t+n )`, inverse is `dec`.
• `dec ( n t -- n t-n )`, inverse is `inc`.
• `csw ( l n t -- <n l> ?t )`, if t=nil swap n and l.
• `cons ( [n] t -- [n t] )`, inverse is `sonc`.
• `snoc ( [n t] -- [n] t )`, inverse is `cons`.
• `roll ( n t -- n t<<n )`, leftward bit cycling, inverse is `roll(t,-n)`.
• `mul ( l n t -- l n l*n+t )`, 0<=x<z, inverse is `div`.
• `div ( l n t -- l n t-l*n )`, 0<=x<z, inverse is `mul`.
• `rot ( l n t -- n t l )`, TODO.
• `tor ( l n t -- t l n )`, TODO.
• `flip ( l n t -- t n l )`, TODO.
• `quote ( [t] -- '[t] )`, TODO.
• `eval ( [t] -- t )`, TODO.
• `apply ( n [t] -- t(n) )`, TODO.

#### #concatenative combinators

Reversible but wastes allocation.

• `i ( [t] -- t )`, inverse is `unit`.
• `unit ( t -- [t] )`, inverse is `i`.

#### #non-linear(helpers)

Non-reversible.

• `cdr ( n t -- n )`, non reversible.

### #Build

You must have an Uxn assembler and emulator.

```uxnasm src/yo-joy.tal bin/yo-joy.rom
uxnemu bin/yo-joy.rom
```

If do not wish to assemble it yourself, you can download yo-joy.rom.