urbit/base/pub/doc/nock.md
Anton Dyudin 80ac6ffe0a Revert "remove docs for demo", "remove odds and ends", "demo network", "DEMO ONLY: root beak as %demo."
This reverts commit 8e1e40d75b3ab15c194b6bf9570f3edc46e2de58.
This reverts commit f073c490f9fd7c5abc033af4857df92229877de7.
This reverts commit f187d2d7e01a54823f3e979af9bbd148b398e7e9.
This reverts commit bc272862a73cfce1b118586ca39d3a377d841f1b.

Conflicts:
	urb/urbit.pill
2015-06-05 14:03:30 -07:00

1.3 KiB

nock

nock is our machine code.

nock is a homoiconic combinator algebra, not much fancier than SKI combinators. The spec fits on a T-shirt and gzips to 340 bytes.

Think of nock as a kind of functional assembly language. It's not like assembly language in that it's directly executed by the hardware. It is like assembly language in that:

  • Everything in Urbit executes as nock.
  • You wouldn't want to program directly in nock.
  • Learning to program directly in nock is a great way to start understanding urbit from the ground up.

Just as Unix runs C programs by compiling them to assembler, Urbit runs Hoon programs by compiling them to nock. You could try to learn Hoon without learning nock. But just as C is a thin wrapper over the physical CPU, Hoon is a thin wrapper over the nock virtual machine. It's a tall stack made of thin layers, which is much easier to learn a layer at a time.

And unlike most fundamental theories of computing, there's really nothing smart or interesting about nock. Of course, in a strictly formal sense, all of computing is math. But that doesn't mean it needs to feel like math. nock is a simple mechanical device and it's meant to feel that way.