on master help sign in
scratching the surface
commitf41079f2372af9bcb25ad065d8eb8f0bfae82d6f authorGalen Wolfe-Pauly <root@office-for.com> dateMon 14 Mar 2016, 17:06 (11 years ago) parente0e10ec
5 files changed+62−185
docs.md+2−2 docs/orientation/repo-guide.md+14−21 docs/orientation/system-overview.md+24−2 docs/orientation/what-is-urbit.md−137 docs/setup/install.md+22−23
docs.md+2−2
@@ -3,10 +3,10 @@ anchor: none
33---
44
55<div class="lead">
6− <div class="logo inverse blue">~</div>
6+ <div class="logo inverse"></div>
77 <h1 class="blue i-b">Urbit docs</h1>
88</div>
99
1010<div class="sections lead-offset">
1111 <kids></kids>
12−</div>
12+</div>
docs/orientation/repo-guide.md+14−21
@@ -1,14 +1,14 @@
11---
22next: true
3−sort: 3
4−title: What's in the repo
3+sort: 2
4+title: Arvo source guide
55---
66
7−# What's in the repo
7+# Arvo source guide
88
9−The `urbit` repo can look a little confusing at first. Here we'll take a look at the files that live on your `/=home=` desk by default.
9+When you boot an Urbit we transfer the current version of the Arvo operating environment to your Urbit over our network. That is, the source for the system lives on your Urbit. Here we'll take a brief tour through the structure of a base Arvo desk.
1010
11−If you `ls urb/zod` from inside the urbit repo you should see something like:
11+Looking at the top level of [the Arvo repo](http://github.com/urbit/arvo), or any Urbit desk that has been mounted to Unix we see something like:
1212
1313 app/
1414 arvo/
@@ -16,6 +16,7 @@ If you `ls urb/zod` from inside the urbit repo you should see something like:
1616 lib/
1717 mar/
1818 ren/
19+ sec/
1920 sur/
2021 web/
2122 web.md
@@ -24,7 +25,7 @@ Let's step through directory by directory.
2425
2526## `app/`
2627
27−This is where `%gall` apps live. `%gall` apps are stateful servants. Sort of like unix daemons. One very familiar one is `app/talk.hoon` which is the source code for `:talk` the urbit messaging transport layer. And there's also `app/dojo.hoon` — that's your shell.
28+This is where `%gall` apps live. `%gall` apps are stateful servers, sort of like unix daemons. One very familiar one is `app/talk.hoon` which is the source code for `:talk` the urbit messaging transport layer. And there's also `app/dojo.hoon` — that's your shell.
2829
2930## `arvo/`
3031
@@ -60,25 +61,17 @@ This is where the `%arvo` vanes live. Vanes are sort of like kernel modules. Th
6061
6162### `arvo/hoon.hoon`
6263
63−`%hoon` is our programming langauge.
64−
65−### `arvo/jael.hoon`
66−
67−`%jael` handles secret storage.
68−
69−### `arvo/kahn.hoon`
70−
71−`%kahn` stores your contacts / trust graph.
64+`%hoon` is our programming langauge. Since Hoon compiles itself the language is actually specified in its source.
7265
7366### `arvo/zuse.hoon`
7467
75−`%zuse` is our standard library.
68+`%zuse` is the Hoon library.
7669
7770That's it. That's the whole system.
7871
7972## `gen/`
8073
81−`gen/` holds generators. Generators are short command-line scripts.
74+`gen/` holds generators. Generators are command-line scripts.
8275
8376## `lib/`
8477
@@ -86,9 +79,7 @@ That's it. That's the whole system.
8679
8780## `mar/`
8881
89−This is where marks live. Marks are data type definitions used by `%ford` and `%clay`.
90−
91−Marks define how diffs are performed on a particular data type and how they can be translated to different types. Sort of like file extensions, but much more powerful.
82+This is where marks live. Marks are data type definitions used by `%ford`. A mark is like a mime-type, but precisely specified in executable code.
9283
9384## `ren/`
9485
@@ -100,11 +91,13 @@ Default web requets in urbit are handled as a `.urb`, which is caught by the `ur
10091
10192`sur/` contains shared data structures.
10293
94+Files in `sur` are like headers in C.
95+
10396## `web/`
10497
10598There are the files publicly accessible to the web, as made possible by `%eyre`.
10699
107100## `web.md`
108101
109−This is the homepage for your urbit. You'll see it at `http://localhost:8080/` or `http://your-urbit.urbit.org/`
102+This is the homepage for your urbit. You'll see it at `http://localhost:8080/` or `http://your-urbit.urbit.org/`.
110103
docs/orientation/system-overview.md+24−2
@@ -1,11 +1,33 @@
11---
22next: true
3−sort: 2
3+sort: 1
44title: System overview
55---
66
77# System Overview
88
9+Urbit is a clean-slate system software stack defined as a
10+deterministic computer. An encrypted P2P network, `%ames`, runs
11+on a functional operating system, Arvo, written in a strict,
12+typed functional language, Hoon, which compiles itself to a
13+combinator interpreter, Nock, whose spec gzips to 340 bytes.
14+
15+## Architectural overview
16+
17+A deterministic computer? Urbit's state is a pure function of
18+its event history. In practice it uses a memory checkpoint and
19+an append-only log. Every event is a transaction; Urbit is an
20+ACID database and a single-level store. Urbit runs on Unix now,
21+but it's easy to imagine on a hypervisor or even bare metal.
22+
23+A purely functional OS? Urbit is pure -- no code inside it can
24+make system calls or otherwise affect the underlying platform.
25+Instead, the top-level event function defines an I/O protocol.
26+It maps an input event and the current state to a list of output
27+actions and the subsequent state. In Hoon:
28+
29+ $+([event state] [(list action) state])
30+
931### Nock
1032
1133Nock is a sort of nano-Lisp without syntax, symbols or lambdas.
@@ -60,4 +82,4 @@ a self-hosted Slack or persistent IRC.
6082
6183The full Urbit stack (compiler, standard library, kernel,
6284modules, and applications) is about 25,000 lines of Hoon.
63−Urbit is patent-free and MIT licensed.
85+Urbit is patent-free and MIT licensed.
docs/orientation/what-is-urbit.mddeleted−137
@@ -1,137 +0,0 @@
1−---
2−next: true
3−sort: 1
4−title: What is Urbit?
5−---
6−
7−# What is Urbit?
8−
9−Urbit is a clean-slate system software stack defined as a
10−deterministic computer. An encrypted P2P network, `%ames`, runs
11−on a functional operating system, Arvo, written in a strict,
12−typed functional language, Hoon, which compiles itself to a
13−combinator interpreter, Nock, whose spec gzips to 340 bytes.
14−
15−What is Urbit for? Most directly, Urbit is designed as a
16−personal cloud server for self-hosted web apps. It also uses
17−HTTP APIs to manage data stuck in traditional web applications.
18−
19−More broadly, Urbit's network tackles identity and security
20−problems which the Internet can't easily address. Programming
21−for a deterministic single-level store is also a different
22−experience from Unix programming, regardless of language.
23−
24−## Architectural overview
25−
26−A deterministic computer? Urbit's state is a pure function of
27−its event history. In practice it uses a memory checkpoint and
28−an append-only log. Every event is a transaction; Urbit is an
29−ACID database and a single-level store. Urbit runs on Unix now,
30−but it's easy to imagine on a hypervisor or even bare metal.
31−
32−A purely functional OS? Urbit is pure -- no code inside it can
33−make system calls or otherwise affect the underlying platform.
34−Instead, the top-level event function defines an I/O protocol.
35−It maps an input event and the current state to a list of output
36−actions and the subsequent state. In Hoon:
37−
38− $+([event state] [(list action) state])
39−
40−### Nock
41−
42−Nock is a sort of nano-Lisp without syntax, symbols or lambdas.
43−Most Lisps are one-layer: they create a practical language by
44−extending a theoretically simple interpreter. The abstraction is
45−simple and the implementation is practical; there is no actual
46−codebase both simple and practical. Hoon and Nock are two
47−layers: Hoon compiles itself to pure Nock. Since Urbit is
48−defined in Nock, not Hoon, we can upgrade Hoon over the air.
49−
50−The Nock data model is especially trivial. A *noun* is an atom
51−or a cell. An atom is any unsigned integer. A cell is an
52−ordered pair of nouns. Nouns are acyclic and expose no pointer
53−equality test.
54−
55−### Hoon
56−
57−Hoon is a strict combinator language that avoids mathematical
58−theory and notation. It aims at a mechanical, imperative feel.
59−Hoon uses ASCII digraphs instead of keywords; there are no
60−user-level macros. The type system infers only forward and does
61−not use unification, but is not much weaker than Haskell's. The
62−compiler and inference engine is about 2000 lines of Hoon.
63−
64−### Arvo
65−
66−Arvo is an event-driven OS written in Hoon. It can upgrade
67−itself and everything inside it over the network. The Arvo
68−kernel proper is 500 lines of Hoon, which implements a typed
69−event system with explicit call-stack structure. Arvo ships
70−with modules that provide P2P networking (`%ames`), a revision-
71−control system (`%clay`), a web client/server (`%eyre`), a
72−functional build system (`%ford`), and an application engine
73−`(%gall)`.
74−
75−### `%ames`
76−
77−`%ames`, the Urbit network, is an encrypted P2P protocol over
78−UDP. Its address space is semi-decentralized; 64-bit addresses
79−are hierarchically distributed, 128-bit addresses are
80−self-created. Addresses (or *plots*) are rendered in a phonemic
81−syntax for memorability. The scarcity of short plots helps
82−control spam and other Sybil attacks. The short plot hierarchy
83−is also reused as a supernode routing system for NAT traversal.
84−
85−### Apps
86−
87−Urbit ships with two default applications: a REPL or shell
88−`:dojo`, and a distributed user-level message-bus `:talk`.
89−`:talk` under the hood resembles NNTP; to the user, it looks like
90−a self-hosted Slack or persistent IRC.
91−
92−The full Urbit stack (compiler, standard library, kernel,
93−modules, and applications) is about 25,000 lines of Hoon.
94−Urbit is patent-free and MIT licensed.
95−
96−## Status
97−
98−Anyone can run the Urbit VM, of course. But the `%ames` network
99−is officially invitation-only. Not that we're antisocial -- just
100−that we're under construction.
101−
102−Right now, Urbit's only practical use is to (a) build Urbit and
103−(b) talk about Urbit. Its performance is lamentable. Its
104−documentation is inadequate. Its keys are test keys. Its
105−planets explode on a regular basis. We reserve the right to
106−reboot ("flag-day") the whole network.
107−
108−However, Urbit is at least out of research mode and focused more
109−or less exclusively on optimization and bug-fixing. So at least,
110−whatever you learn will stay true. And bleeding edges are fun.
111−
112−## Getting involved
113−
114−If you're interested in following Urbit, you can:
115−
116−- Read our documentation at
117− [urbit.org](http://urbit.org/docs)
118−- Subscribe to our newsletter at [urbit.org](http://urbit.org).
119−- Check out the
120− [urbit-dev](https://groups.google.com/forum/#!forum/urbit-dev)
121− mailing list.
122−- Follow [@urbit_](https://twitter.com/urbit\_) on Twitter.
123−- Hit us up by email, <span class="mono">urbit@urbit.org</span>.
124− We're nice!
125−
126−## Code of conduct
127−
128−Everyone involved in the Urbit project needs to understand and
129−respect our code of conduct, which is: "don't be rude."
130−
131−## Pronunciation and etymology
132−
133−Urbit is always pronounced "herb it," never "your bit." Not that
134−it's not your bit! But "herb it" just sounds better. (Yes, we
135−speak American and the 'h' is silent.)
136−
137−The origin of the name is just the Latin *urbi*, meaning city.
docs/setup/install.md+22−23
@@ -10,20 +10,6 @@ Urbit can be installed on most Unix systems. There is no Windows
1010port. Windows is a wonderful OS, we just haven't gotten to it yet.
1111Use a VM.
1212
13−## Configure the OS
14−
15−Urbit wants to map 2GB of memory when it boots up. We won't
16−necessarily use all this memory, we just want to see it. On a
17−normal modern PC or Mac, this is not an issue. On some small
18−cloud virtual machines (Amazon or Digital Ocean), the default
19−memory configuration is smaller than this, and you need to
20−manually configure a swapfile.
21−
22−Digital Ocean has a post on adding swap [here](https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04). For Amazon there's a StackOverflow thread [here](http://stackoverflow.com/questions/17173972/how-do-you-add-swap-to-an-ec2-instance).
23−
24−Don't spend a lot of time tweaking these settings; the simplest
25−thing is fine.
26−
2713## Install as a package
2814
2915### OS X - Homebrew
@@ -39,9 +25,9 @@ Third-party packages are available, at:
3925Urbit is only supported on Jessie onward (but outbound HTTPS
4026requests only work on Stretch; I wish we knew why; help us!)
4127
42−## Hand-build from source
28+## Build from source
4329
44−First, install all external dependencies. Then, make.
30+First, install all external dependencies. Then, download and make.
4531
4632### Dependencies
4733
@@ -68,6 +54,10 @@ urbit depends on:
6854
6955 sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c
7056
57+#### FreeBSD
58+
59+ pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
60+
7161#### AWS
7262
7363 sudo yum --enablerepo epel install gcc gcc-c++ git gmp-devel openssl-devel ncurses-devel libsigsegv-devel ctags automake autoconf libtool cmake re2c
@@ -81,18 +71,13 @@ urbit depends on:
8171 sudo port install git gmp libsigsegv openssl autoconf automake cmake
8272
8373Although `automake`/`autoconf`/`libtool` are generally installed by
84−default, some have reported needing to uninstall and reinstall those
85−three packages, at least with Homebrew. Your mileage may vary.
86−
87−#### FreeBSD
88−
89− pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
74+default, some have reported needing to uninstall and reinstall those three packages, at least with Homebrew. Your mileage may vary.
9075
9176### Download and make
9277
9378Clone the repo:
9479
95− git clone git://github.com/urbit/urbit.git
80+ git clone https://github.com/urbit/urbit
9681
9782`cd` to the directory you just created:
9883
@@ -103,3 +88,17 @@ Run `make`:
10388 make
10489
10590(On FreeBSD, use `gmake` instead.)
91+
92+## Setting up swap
93+
94+Urbit wants to map 2GB of memory when it boots up. We won't
95+necessarily use all this memory, we just want to see it. On a
96+normal modern PC or Mac, this is not an issue. On some small
97+cloud virtual machines (Amazon or Digital Ocean), the default
98+memory configuration is smaller than this, and you need to
99+manually configure a swapfile.
100+
101+Digital Ocean has a post on adding swap [here](https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04). For Amazon there's a StackOverflow thread [here](http://stackoverflow.com/questions/17173972/how-do-you-add-swap-to-an-ec2-instance).
102+
103+Don't spend a lot of time tweaking these settings; the simplest
104+thing is fine.