Nock#

Nock is a computational specification which can be described as an instruction set architecture, a programming language, or a behavior standard. Nock seeks a balanced minimalism which makes it easy to reason about and prove statements about. “As simple as viable, and no simpler.”

Today, Nock is used as the computational layer for Urbit and NockApp (currently shipped as part of Nockchain).

This site will interactively teach you about Nock and the high-level languages that compile to it:

  • Hoon, an assembly-like systems language (the “C” of Nock).

  • Jock, a user-friendly scripting language (the “Python” of Nock).

What is Nock?#

Nock is a minimal combinator calculus that serves as the foundation for functional programming systems like Urbit. This tutorial provides multiple perspectives on understanding Nock, from theoretical foundations to practical implementation.

Nock as a computing platform is:

  • Turing-complete. It’s a complete real language with all that implies.

  • Functional-as-in-language. Necessary side effects are achieved through runtime hints. There is no undefined behavior in the specification.

  • Homoiconic. Code and data share the same representation.

  • Solid-state. Each evaluation is deterministic and self-contained, resulting in a new updated state with no transient state from crashes or system (mis)configuration.

  • Tiny. Only twelve opcodes are necessary for the full specification, and first-class virtualization allows this capability to be arbitrarily extended.

How to Use This Tutorial#

Let’s dive in!