##Nock, 6 characters##
Nock, 6 characters
[ ]012
Nock is a minimal virtual machine based on combinator reduction. It's memory model is a binary tree of bignums, and the spec gzips to 340 bytes. There's a trivial transformation from Nock operations to the SKI combinators, which I stole from the Urbit examples library (which seems to originate from this reddit discussion):
S = [[1 1 2] [1 0 1] [1 1] 0 1]
K = [[1 1] 0 1]
I = [0 1]
A more interesting way to do this would be to re-compile Nock with the Nock 4 operator, which is increment, to create the other operators. [4 1 1]
is 2, [4 4 1 1]
is 3, etc. S could alternatively be defined [[1 4 1 1] [1 0 1] [1 1] 0 1]
, for example. I think that you still need a non-synthesized 2 operator in order to apply functions and reduce the 4, though.