on 01ac191 help sign in
urbit.org/docs/about/overview.md
90 lines 3.5 kB history raw
1---
2next: true
3sort: 1
4title: System overview
5navhome: /main
6---
8# System Overview
10<div class="row"><div class="col-md-8">
12Urbit is a clean-slate system software stack defined as a
13deterministic computer. An encrypted P2P network, `%ames`, runs
14on a functional operating system, Arvo, written in a strict,
15typed functional language, Hoon, which compiles itself to a
16combinator interpreter, Nock, whose spec gzips to 340 bytes.
18</div></div>
20## Architectural overview
22A deterministic computer? Urbit's state is a pure function of
23its event history. In practice it uses a memory checkpoint and
24an append-only log. Every event is a transaction; Urbit is an
25ACID database and a single-level store. Urbit runs on Unix now,
26but it's easy to imagine on a hypervisor or even bare metal.
28A purely functional OS? Urbit is pure -- no code inside it can
29make system calls or otherwise affect the underlying platform.
30Instead, the top-level event function defines an I/O protocol.
31It maps an input event and the current state to a list of output
32actions and the subsequent state. In Hoon:
34 $+([event state] [(list action) state])
36### Nock
38Nock is a sort of nano-Lisp without syntax, symbols or lambdas.
39Most Lisps are one-layer: they create a practical language by
40extending a theoretically simple interpreter. The abstraction is
41simple and the implementation is practical; there is no actual
42codebase both simple and practical. Hoon and Nock are two
43layers: Hoon compiles itself to pure Nock. Since Urbit is
44defined in Nock, not Hoon, we can upgrade Hoon over the air.
46The Nock data model is especially trivial. A *noun* is an atom
47or a cell. An atom is any unsigned integer. A cell is an
48ordered pair of nouns. Nouns are acyclic and expose no pointer
49equality test.
51### Hoon
53Hoon is a strict combinator language that avoids mathematical
54theory and notation. It aims at a mechanical, imperative feel.
55Hoon uses ASCII digraphs instead of keywords; there are no
56user-level macros. The type system infers only forward and does
57not use unification, but is not much weaker than Haskell's. The
58compiler and inference engine is about 2000 lines of Hoon.
60### Arvo
62Arvo is an event-driven OS written in Hoon. It can upgrade
63itself and everything inside it over the network. The Arvo
64kernel proper is 500 lines of Hoon, which implements a typed
65event system with explicit call-stack structure. Arvo ships
66with modules that provide P2P networking (`%ames`), a revision-
67control system (`%clay`), a web client/server (`%eyre`), a
68functional build system (`%ford`), and an application engine
69`(%gall)`.
71### `%ames`
73`%ames`, the Urbit network, is an encrypted P2P protocol over
74UDP. Its address space is semi-decentralized; 64-bit addresses
75are hierarchically distributed, 128-bit addresses are
76self-created. Addresses (or *plots*) are rendered in a phonemic
77syntax for memorability. The scarcity of short plots helps
78control spam and other Sybil attacks. The short plot hierarchy
79is also reused as a supernode routing system for NAT traversal.
81### Apps
83Urbit ships with two default applications: a REPL or shell
84`:dojo`, and a distributed user-level message-bus `:talk`.
85`:talk` under the hood resembles NNTP; to the user, it looks like
86a self-hosted Slack or persistent IRC.
88The full Urbit stack (compiler, standard library, kernel,
89modules, and applications) is about 25,000 lines of Hoon.
90Urbit is patent-free and MIT licensed.