on master help sign in
new plans
commit17441dcdc66a5cdcdcddc9e937fe93c74790963e authorGalen Wolfe-Pauly <root@office-for.com> dateFri 12 May 2017, 13:22 (9 years ago) parent30ce60b
2 files changed+250
main/blog/2017.5-frozen.md+128 main/blog/2017.5-plans.md+122
main/blog/2017.5-frozen.mdnew file+128
@@ -0,0 +1,128 @@
1+---
2+date: ~2017.5.10
3+type: post
4+title: Toward a frozen operating system
5+preview: Is it possible to freeze an entire OS?
6+author: Curtis Yarvin + Galen Wolfe-Pauly
7+layout: urbit,post
8+navmode: navbar
9+navdpad: false
10+navselect: blog
11+navpath: /
12+navhome: /
13+navclass: urbit
14+---
15+
16+<br /><br />
17+
18+Is it possible to freeze an entire OS, so that its codebase never changes and never has to change? Is the proposition even meaningful? Is it practical? And if so, why would we want a frozen OS?
19+
20+Think about it intuitively. There's a reason we call an OS a "platform." It's a piece of permanent infrastructure. Paul Graham wrote a [great essay](http://www.paulgraham.com/hundred.html) about the "hundred-year language," but the language is only one part of any complete platform. And in infrastructure terms, a hundred years isn't that long.
21+
22+Why not think of structures that have lasted *thousands* of years? An aqueduct, a pyramid, a Parthenon? Why set our sights lower? Why isn't it time to aim for perfect and timeless code? If not now, when?
23+
24+## Scope of the problem
25+
26+More prosaically, a frozen OS just means your OS never changes. A frozen OS never gets any updates. Not because it can't update itself, just because it doesn't need to.
27+
28+Is this even a meaningful concept? A frozen OS? First we'll have to decide what "OS" even means. Certainly, if "OS" means "the code that your hardware boots into," hardware always changes and so will the OS.
29+
30+A broader, more useful definition: the "OS" is *an opaque model of a persistent general-purpose computer*. This definition allows for arbitrary levels of virtualization. Linux on a droplet is an OS. A browser is an OS, because it's persistent (sorta) and opaque. But `node.js` is not an OS, because it's not opaque: it exports Linux system calls.
31+
32+Within this opaque model, we have to decide what's "system" and "user" software. It clearly makes no sense to freeze userspace. Let's use the [trusted codebase](https://en.wikipedia.org/wiki/Trusted_computing_base): code is system software, if compromising it would compromise the whole system.
33+
34+## Infinite maturity
35+
36+It's important to remember that just because a system is designed to achieve frozenness, doesn't mean it's useless until it’s frozen. It doesn't even mean it's immature. It just means that in the very long term, the system’s maturity goals are infinite.
37+
38+Systems designed to diverge infinitely (with normal X.X.X semantic versioning), even those designed to converge infinitely (as with [Knuth versioning](http://www.tex.ac.uk/FAQ-TeXfuture.html)), also achieve maturity, often great maturity, without being quite frozen.
39+
40+For example, C is a very mature language. C has long since mastered backward compatibility. We can be sure that any C program which compiles on today's correct C compilers will compile on any future correct C compiler.
41+
42+But, since C is not frozen, we can't be sure that today's C compilers will compile any future C program. So C has not yet achieved perfect *forward* compatibility. By definition, a frozen system is compatible both forward and backward. So C is mature, but it could still get more mature.
43+
44+The point of a frozen OS is to shoot for *infinite* maturity. Obviously a frozen platform is compatible forever in both directions.
45+
46+Infinite maturity does exist in the real world. But only in a few simple file formats and protocols — IP, JSON, XML. And not all this maturity is the result of perfection. Some is just the accident of a missing update mechanism.
47+
48+But IP, JSON, XML... this is how stable, how taken for granted, system software should be. And can be. Certainly, any JSON parser today will parse any JSON document made in the future.
49+
50+The dream of absolute zero is an OS whose core components are so simple, so boring, and so mechanically straightforward that we can imagine them becoming finished and never changing. We need to freeze not just a format or a protocol, but a language, a kernel, a standard library. To succeed, we need to flush out each quirk, complexity, and creeping feature, until the system is so boring and obvious that no one even wants to change it.
51+
52+## Kelvin versioning
53+
54+"Kelvin versioning" is one way to track a project designed to be frozen.
55+
56+In Kelvin versioning, a version is an integer in degrees Kelvin. Absolute zero is frozen — no further updates are possible. If your Kelvin versions don't track your actual progress, you run out of integers. This danger is a concrete incentive for the project to track its own progress accurately.
57+
58+(Kelvin versioning isn't useful only at lifecycle scale. It can be used for any development process with an irreversible end — as build numbers for a release, for example.)
59+
60+## The palm-tree dependency model
61+
62+A whole OS can't have a single Kelvin number. It has to consist of multiple components which depend on each other. What's the right dependency model for the parts of a frozen OS?
63+
64+One way to think about dependencies across a whole OS is the "palm-tree model." Fundamentally, there are two kinds of components in a system: "exclusive" components (where we have to choose one version of the code), and "inclusive" ones (where different users can see different versions).
65+
66+The exclusive components are the trunk of the palm tree: a stack of layers, each of which has one active copy. For instance, you are only running one kernel at a time. Different apps cannot use different versions of the kernel.
67+
68+The inclusive components are the fronds, branching out in any direction they want. Not only can two apps use different versions of the same library, in many situations *one* app needs to be able to use two different versions of the same library.
69+
70+## The palm trunk: telescoping Kelvins
71+
72+Any subsystem that serves as any kind of platform is exclusive, since anything that runs on top of the platform has to choose one version of the platform to run on. Since layers are good, this creates a natural stack which can get quite tall — and include components which are technically in userspace.
73+
74+The right way for this trunk to approach absolute zero is to "telescope" its Kelvin versions. The rules of telescoping are simple:
75+
76+1. If tool B sits on platform A, either both A and B must be at absolute zero, or B must be warmer than A.
77+
78+2. Whenever the temperature of A (the platform) declines, the temperature of B (the tool) must also decline.
79+
80+3. B must state the version of A it was developed against. A, when loading B, must state its own current version, and the warmest version of itself with which it's backward-compatible.
81+
82+Of course, if B itself is a platform on which some higher-level tool C depends, it must follow the same constraints recursively.
83+
84+The important effect of obeying rule 2: in a tall trunk, it's sufficient to state your dependency on the platform directly below you. Suppose C sits on B, which sits on A and exports features of A. C can state only the version of B it's written against, because when A chills, B must also chill.
85+
86+If A could chill without B chilling, we could modify C to use new features of A. Then our new C would silently fail to work on an A-B stack which had not received the A update.
87+
88+## The palm fronds: total flexibility
89+
90+The goal of the trunk is to get to the fronds. In the fronds, no one should ever worry about dependency conflicts. And nothing is ever frozen, or has to be frozen.
91+
92+The right way to solve dependencies in userspace is: within an organization, use a monorepo and link relative to its head. Between organizations, use pinned version numbers that are as immutable as possible. Avoid programming environments that create exclusion problems in userspace — for instance, that compel a single process to choose one version of a library when a diamond dependency exists.
93+
94+There is almost never any good reason to automatically update dependencies with fresh versions of foreign code. In the case of a security update, the maintainer of an app which depends on a patched library needs to catch the patch and propagate the update in a new version of the app. An app shouldn’t be security-critical to begin with, and propagating updates is a basic function of a modern OS. Also, if the app is security-critical, it could have its own bugs, so it needs a maintainer and an update pathway anyway.
95+
96+## Urbit: status and prospects
97+
98+Yes, we do believe it's possible to write a freezable OS. In fact, we wrote one. And it works. It's not yet frozen (except at the bottom layer), but it's getting there.
99+
100+Urbit, a clean-slate functional OS, has been under development since 2002. It took a decade (as a one-man project) just to build a prototype of a freezable OS. The result in 2017 (now with a small company) is a telescoping Kelvin stack of layers from VM to UI.
101+
102+At the bottom (the VM Nock), this stack is slightly warmer than liquid helium (5K). It's easy for Nock to get this cold, because it's defined in a page of axioms that gzips to 340 bytes. We are in no hurry to declare zero, but any change at this point would be both very unlikely and very difficult to implement.
103+
104+Urbit's typed functional language, Hoon, which compiles itself to Nock, is closing in on liquid krypton at 143K. Hoon is defined in about 5,000 lines of Hoon, or 10,000 if you count the deep standard library. Nock will never need to change; Hoon is perfectly serviceable but has some well-known rough spots.
105+
106+Above Hoon, the stack rapidly gets much warmer. Arvo is an event-driven microkernel that's 1,000 lines of Hoon. Above this are another 5,000 lines of system library, then 12,000 lines of Arvo modules: a peer-to-peer network, a PKI and private ledger, a revision-control system, an HTTP gateway, a functional build system, and an application sandbox. A trivial working system needs another 5,000 lines for basic chat and shell apps.
107+
108+We haven't had meaningful Kelvin numbers for the Arvo layer, but this release will change that. About a third of Arvo has been or will be rewritten in the last year; we'll assign Kelvins once this code (which now compiles) is tested into existence, largely based on how close the last compiling draft was to the first working draft. But you'll certainly be able to cook eggs on it.
109+
110+(Once again, not being frozen doesn't mean not working. Until all these layers are finished, we'll be updating them over the air. To be exact, Urbit distributes its own updates through subscriptions in its own revision-control system.)
111+
112+The actual status of Urbit is that in 2017, we hope to make our last discontinuous update — meaning that instead of your Urbit node updating itself silently, you destroy and recreate it. Urbit works today, but it isn't really alive until today's Urbit data lives forever.
113+
114+Even committing to continuity is a significant step toward the frozen OS, because we're committing to never making another change that the present platform can't install. Fortunately, the only layer that has to stay frozen for this is Nock.
115+
116+## The style of convergent system software
117+
118+We're obviously in no position to declare victory at any layer above Nock, but aiming at absolute zero creates a system design style we think works very well — even if we never get to zero.
119+
120+Deep, onion-like layering is essential. A thin layer has no room to grow. A good example of this principle is the difference between Urbit and Lisp machines. Both Nock and Lisp are very simple axiomatic definitions of computing. But practical Lisp systems expand by extending the model, whereas Urbit layers over a frozen axiom system.
121+
122+Software that expands by extension is inevitable. But we need to be able to kick it up to userspace. System software should be concerned with the fundamental problems of computing, which don't change. The few cases in which they do change — like crypto algorithms — are special cases, easily encapsulated. And even these changes can be expected to slow down in the long term.
123+
124+Perhaps the best example of the convergent style in existing, mature system software is the relational database. The genius of the relational model is that it's designed to never grow hair. Even SQL, with its COBOL-era syntax, is essentially invulnerable to any significant non-cosmetic improvement.
125+
126+The lesson: when we see a system that seems to want to expand indefinitely, we can and should look for a layer division within this system, separating an inner layer that tends to converge from an outer layer that naturally diverges. Layering is what distinguishes true system software from the giant balls of mud that all deep codebases want to become.
127+
128+Are all balls of mud, or at least all the muddy parts of an OS, susceptible to this transformation? We think so. But we'll see.
main/blog/2017.5-plans.mdnew file+122
@@ -0,0 +1,122 @@
1+---
2+date: ~2017.5.11
3+type: post
4+title: Urbit roadmap ~2017.5
5+preview: From AVP to MVP
6+author: Curtis Yarvin + Galen Wolfe-Pauly
7+layout: urbit,post
8+navmode: navbar
9+navdpad: false
10+navselect: blog
11+navpath: /
12+navhome: /
13+navclass: urbit
14+---
15+
16+<br /><br />
17+
18+Urbit today (May 2017) is a working proof-of-concept. The Urbit test network has been up continuously since last August, hosting its own distributed chat, distributing its own updates, serving its own website and forum, etc, etc.
19+
20+Everyone has heard of the minimum viable product (MVP). Urbit in summer 2016 (the current test network) is the MVP's first cousin: the AVP (almost-viable product).
21+
22+## From AVP to MVP
23+
24+Urbit is an open-source project. Its sponsor, Tlon, is a company. So we can't exactly tell the public to *go away*. But there is nothing much the public can use Urbit for, besides hanging around and talking about Urbit.
25+
26+Going from AVP to MVP means changing that. And of course, it means issuing real Urbit keys. And promoting Urbit to users. And preaching it at developers. And all that normal stuff. But not until we're ready, because we ship only the most beautiful bits.
27+
28+Sometimes we forget to remind people that *no one has ever built anything even remotely like Urbit*. It's not like, people had cars, so we built a better car. It's like, people had cars, so we built a [rocket unicycle](https://media.urbit.org/whitepaper.pdf).
29+
30+Our rocket unicycle is a lot more awesome than a Chevy. But it demands more custom engineering. We have to invent every little widget as we need it. Usually that involves rebuilding it two or three times (see the [long-term strategy](/blog/2017.5-frozen/)). This process converges from the bottom of the stack up, and accelerates as our progress advances.
31+
32+Nock, which is now frozen, and which is a page of pseudocode, took from 2002 to 2008 to invent. Hoon took from 2008 to 2012, and is stable but not frozen. All the real technical problems in 2016 Urbit are either in the top layers (Arvo, its vanes and apps), or outside Urbit proper (Vere, the Unix event processor).
33+
34+Except for one major component (the security vault `%jael`), there isn't any single big thing wrong with 2016 Arvo or Vere. In retrospect, they can even be seen as inspired stabs in the right direction. But hammering square pegs into round holes isn't the Urbit way.
35+
36+If we made our AVP into an MVP by straight-out *debugging*, we'd be limping across the finish line. An MVP must be minimal in affordances. In its aesthetics, it must be sublime. It has the rest of its life to grow features, but beauty only fades.
37+
38+## A parallel process
39+
40+Architecture is entropy in reverse. Urbit has to become *more* elegant, as it becomes more functional. This delicate process must be carefully controlled.
41+
42+To keep Urbit on the path to absolute zero, we have to work in three directions at the same time:
43+
44+- Stabilizing the Urbit infrastructure
45+- Developing the Urbit user experience
46+- Documenting the Urbit system
47+
48+Pushing in all three directions at once keeps the whole project in balance. We could drop any two of these goals and head at top speed for the other. This would produce a nice simulation of doneness in a single dimension.
49+
50+But if we just hardened our infrastructure from the bottom up, we wouldn't be responding to the needs of the user experience. If we just built a user experience on top of our prototype infrastructure, it wouldn't be stable enough to be usable. If we documented the prototype, it would become much harder to revise. And so on.
51+
52+And the balance between these directions shifts with the seasons. After spending the fall and winter writing infrastructure, and the spring testing it, it'll be time to spend summer and fall working toward the user and the developer.
53+
54+## Since the last crowdsale
55+
56+Maybe this is too vague. What we actually did since the last crowdsale:
57+
58+We replaced about half the Unix interpreter (the whole `vere` directory, event handing and storage), and about a third of Arvo: the lifecycle function, boot sequence and kernel `%arvo`, the network `%ames`, the PKI (adding a new security module `%jael`), the console `:drum`, and the `:talk` app. If Arvo was a car, we replaced the powertrain.
59+
60+At the Hoon level, we added formal docstrings and reorganized (or rather, organized) the kernel and standard library. At the Nock level, we of course did nothing. And on the client side, we redesigned the Web API, and prototyped a completely new Urbit user experience. And all the new code is high-quality, fully documented, and generally ready for anyone to copy and/or abuse.
61+
62+This `cc-release` (continuity candidate) isn't quite done — the Arvo code is written but not fully tested, and one module (the application sandbox `%gall`) is still waiting for its rewrite. But the new Arvo has that "not quite perfect, but basically right" feeling of architectural doneness which Hoon has had for a while.
63+
64+Note that we remain a super-tiny team. We’ve had some serious outside contributions, but clean loose ends that outsiders can pull on remain frustratingly scarce. Hoon is too stable and Arvo is too unstable. Architectural work scales poorly in personnel, and you can’t really renovate a house while people are trying to live in it.
65+
66+## Moving forward
67+
68+After `cc-release` this summer, we’ll move from bottom-up, infrastructure-driven engineering, to top-down, user-driven engineering. Naturally this is `dd-release` (deck-directed).
69+
70+Our planning target is a stable, useful Urbit we can ship in 2017, with roughly our present resources. Since we’re working top-down, we can abandon the deep architectural essays and work, like normal human beings, from an illegible list of features scribbled on a poorly-erased whiteboard.
71+
72+## A whiteboard list
73+
74+Our feature list for `dd-release`, in no particular order:
75+
76+ - The top-level `:deck` UI, an interaction multiplexer like GNU screen, but for terminals or web consoles. (The front end of `:deck` is a working prototype now.)
77+
78+ - The "helpful console," which offers contextual help and lets you construct any dojo command with a wizard-style UI. The three-way combination of a command parser, contextual completion and help, and webform input, may be our most interesting little challenge. We think we know to do it.
79+
80+ - Useful, well-designed web API integrations which contributors can easily clone to extend Urbit's reach. Stars can proxy APIs for their planets, metering free service.
81+
82+ - Integrations for email and SMS are live, so that any ship can at least message its owner. A storage integration to S3, etc, lets us save external blobs. A DNS integration lets us forward ship.urbit.org to ships with public IPs.
83+
84+ - Real keys are ready to be born. An instantiation protocol for the real Urbit keys exists and has received some public review. The current options: physical delivery of tamper-resistant artifacts, or registering ownership on Ethereum or another blockchain. (We'll release a separate essay on this question soon.)
85+
86+ - All key updates at the planet level or above are propagated hierarchically across the network. An offline key can block all transfers. Planet owners can invite their friends to a self-hosted conversation with webmoons (guest accounts).
87+
88+ - The `%eyre` HTTP server is cleaned up and its API simplified. Web programmers see a clear, CQRS-based query and subscription interface in JSON. A cookie makes your browser into a virtual moon, with a unique causal identity for each page instance.
89+
90+ - No user operation can damage the ship, which can be reset to factory condition with just the private key.
91+
92+ - Personal urbits on a home computer don't lose data, except in case of system/OS failure. Mutual exclusion on interrupt handlers is perfect. Timeouts, crashes, and user interrupts are handled perfectly. Snapshot handling is asynchronous and uses two A/B images.
93+
94+ - Urbits are configured to rotate logs by default, so they don't grow infinitely. All caches have continuous expiration, and out-of-memory can't sink a ship. The Web server is secure and has adequate performance without an external cache or any auxiliary servers.
95+
96+ - Urbit can connect its event loop to Kafka or a similar event replication service. Replicated urbits on a hosted service don't lose data, except through acts of God or government.
97+
98+ - One star on a normal virtual host can comfortably manage at least 256 active planets. Dormant planets consume minimal local or remote resources.
99+
100+ - The whole Urbit stack is managed with telescoping Kelvin numbers. Upgrades succeed perfectly or crash the transaction. The stack is permanently upgradeable, even for backward-incompatible changes in Hoon.
101+
102+ - Hand maintenance is only needed to upgrade the Unix interpreter, vere. The owner gets a notification when an obsolete `vere` blocks an Urbit update.
103+
104+ - The new security masks are respected across all vanes. The revision-control system `%clay` has permission masks. Untrusted code can be installed as a gateway to a foreign service with same-origin network permissions.
105+
106+ - Backward-incompatible changes in the Hoon language or Hoon libraries are unlikely. But the Arvo upgrade mechanism can make arbitrary Hoon changes, compatible or not.
107+
108+ - All major Arvo subsystems are architecturally stable. Namespaces, cards, URL routes, the boot sequence, and the upgrade model, are well-specified. Further change in these specs will involve a slow-track community process. But the definitions are stable enough to be taught.
109+
110+ - Architectural overviews of all major Arvo components are attached to the source code. Tutorial documentation for both Hoon and Arvo is good enough to lead a naive programmer up through building a web API gateway (server side Hoon) and a web agent (client side JS).
111+
112+ - Urbit stores and manages all Urbit-related development metadata: todos, bugs, releases, PRs, discussion, etc. It routes this metadata through `:talk` and logs it to `%clay`.
113+
114+ - A precise system coding convention is in place and enforced, if only by measurement. All code in Urbit is graded A, B, or C. Grade A Hoon ("Prime") is well-structured and well-explained. Grade B ("Select") is well-structured, but not well-explained. Grade C ("Choice") is still great code, but its style or technique may not meet our latest standards.
115+
116+ - All code in Urbit except `++ut` (the compiler itself) is grade B. (We can relax standards on the compiler because it tests itself so thoroughly.) All code on the Arvo powertrain (`%arvo`, `%ames`, `%jael`, `%gall`, `:dojo`, `:helm`) is grade A.
117+
118+If you know the current maintenance Urbit, you know that most of these features are mostly in sight. None of them is exactly *quite* complete. None of them is anywhere near a stretch. We have significant parts of all of them.
119+
120+Also, since this is the release after the release we're doing now, we're probably missing as many checkboxes as we've caught. And triage is a thing that happens. It's really better understood as the *kind* of work we're going to do.
121+
122+We'd really like to get all these things done in 2017. But a lot depends on what kinds of resources we have access to. And of course, as we document the system, it gets easier for all the people who believe in Urbit to help us build it.