6 releases (breaking)

Uses old Rust 2015

0.4.0 Apr 16, 2016
0.3.0 Mar 21, 2016
0.2.1 Jan 17, 2016
0.1.0 Oct 25, 2015
0.0.0 Oct 18, 2015

#128 in #vm

Download history 19/week @ 2023-10-29 6/week @ 2023-11-05 7/week @ 2023-11-12 12/week @ 2023-11-19 25/week @ 2023-11-26 16/week @ 2023-12-03 10/week @ 2023-12-10 4/week @ 2023-12-17 17/week @ 2023-12-24 3/week @ 2023-12-31 6/week @ 2024-01-07 8/week @ 2024-01-14 10/week @ 2024-01-21 16/week @ 2024-01-28 6/week @ 2024-02-04 26/week @ 2024-02-11

61 downloads per month
Used in urbit

MIT/Apache

42KB
971 lines

Implementation of the Nock stateless virtual machine

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Implementation of the Nock virtual machine.

See http://urbit.org/docs/theory/whitepaper for more information on Nock.

The Nock spec:

A noun is an atom or a cell.
An atom is a natural number.
A cell is an ordered pair of nouns.

nock(a)          *a
[a b c]          [a [b c]]

?[a b]           0
?a               1
+[a b]           +[a b]
+a               1 + a
=[a a]           0
=[a b]           1
=a               =a

/[1 a]           a
/[2 a b]         a
/[3 a b]         b
/[(a + a) b]     /[2 /[a b]]
/[(a + a + 1) b] /[3 /[a b]]
/a               /a

*[a [b c] d]     [*[a b c] *[a d]]

*[a 0 b]         /[b a]
*[a 1 b]         b
*[a 2 b c]       *[*[a b] *[a c]]
*[a 3 b]         ?*[a b]
*[a 4 b]         +*[a b]
*[a 5 b]         =*[a b]

*[a 6 b c d]     *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
*[a 7 b c]       *[a 2 b 1 c]
*[a 8 b c]       *[a 7 [[7 [0 1] b] 0 1] c]
*[a 9 b c]       *[a 7 c 2 [0 1] 0 b]
*[a 10 [b c] d]  *[a 8 c 7 [0 3] d]
*[a 10 b c]      *[a c]

*a               *a

Dependencies

~190–260KB