Skip to content

Instantly share code, notes, and snippets.

New Mars storyboard

Elevator pitch

An Urbit runtime with near-machine execution speed and NAS-equivalent addressable storage enables most classes of personal applications to be built directly on Urbit.

Wins

Near-machine execution speed

Currently standard library functions which implement highly-iterated loops, such as turn, are jetted to remove arm invocation overhead arising from indirect jumps, dynamic jet matching, and allocation for parameters. The majority of overhead in hot codepaths (such as Ames) is in arm invocations themselves, not in the code for arms.

B+ Tree page directory for New Mars Persistent Memory Arena

Problem

We need to be able to dynamically allocate intervals of memory which will be consistently and durably persisted to disk. This requires mapping memory pages to regions of a disk-backed file. Modifying a page requires that the data first be copied to a new region so that the original data is not corrupted if the process exits with the new data in an inconsistent state or not fully persisted to disk.

This requires a durable mapping of virtual memory page addresses to offsets in the backing file. One solution is to store a metadata table indexed by the base pointer of the new table. This is simple to implement but has some downsides: it must itself be durable, so there is some complexity in ensuring the information for later pages of the table are stored in earlier pages. The table must grow to accomodate the highest virtual memory address used, and cannot efficiently encode contiguous multi-page mappings.

Further, it is unclear whethe

@eamsden
eamsden / build log
Created May 6, 2019 18:35
Iserv infinite recursion
warning: dumping very large path (> 256 MiB); this may run out of memory
error: while evaluating the attribute 'CABAL_CONFIG' of the derivation 'server-manager-two-0.1.1.1-exe-server-manager-two-armv7l-unknown-linux-gnueabihf' at /nix/store/jl95z4fsnaahqpdwh77q21dqqxli2v70-source/pkgs/stdenv/generic/make-derivation.nix:189:11:
while evaluating the attribute 'buildCommand' of the derivation 'server-manager-two-0.1.1.1-exe-server-manager-two-config' at /nix/store/jl95z4fsnaahqpdwh77q21dqqxli2v70-source/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating 'concatMapStringsSep' at /nix/store/jl95z4fsnaahqpdwh77q21dqqxli2v70-source/lib/strings.nix:88:5, called from /home/edward/Work/plow-technologies/git/haskell.nix/builder/comp-builder.nix:95:7:
while evaluating the attribute 'CABAL_CONFIG' of the derivation 'process-1.6.5.0-lib-process-armv7l-unknown-linux-gnueabihf' at /nix/store/jl95z4fsnaahqpdwh77q21dqqxli2v70-source/pkgs/stdenv/generic/make-derivation.nix:189:11:
while evaluating the attribute 'bui
@eamsden
eamsden / BarbieIssue.hs
Created April 24, 2019 15:20
Nested/Recursive Barbie Example
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE UndecidableInstances #-}
module BarbieIssue where
import Data.Barbie
import GHC.Generics
data OuterBarbie f
@eamsden
eamsden / netmaskToCIDR.json
Created April 3, 2019 12:48
JSON netmask -> CIDR mapping
{
"0.0.0.0": 0,
"128.0.0.0": 1,
"192.0.0.0": 2,
"224.0.0.0": 3,
"240.0.0.0": 4,
"248.0.0.0": 5,
"252.0.0.0": 6,
"254.0.0.0": 7,
"255.0.0.0": 8,
-- Logs begin at Fri 2019-03-29 00:12:03 UTC, end at Fri 2019-03-29 00:15:20 UTC. --
Mar 29 00:12:10 localhost systemd[1]: Starting Initial cloud-init job (metadata service crawler)...
Mar 29 00:12:11 localhost cloud-init[754]: Cloud-init v. 0.7.9 running 'init' at Fri, 29 Mar 2019 00:12:11 +0000. Up 11.84 seconds.
Mar 29 00:12:11 localhost cloud-init[754]: ci-info: ++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++
Mar 29 00:12:11 localhost cloud-init[754]: ci-info: +--------+------+--------------+---------------+-------+-------------------+
Mar 29 00:12:11 localhost cloud-init[754]: ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
Mar 29 00:12:11 localhost cloud-init[754]: ci-info: +--------+------+--------------+---------------+-------+-------------------+
Mar 29 00:12:11 localhost cloud-init[754]: ci-info: | lo: | True | 127.0.0.1 | 255.0.0.0 | . | . |
Mar 29 00:12:11 localhost cloud-init[754]: ci-info: | lo: |
-- Logs begin at Thu 2019-03-28 23:31:14 UTC, end at Thu 2019-03-28 23:35:27 UTC. --
Mar 28 23:31:21 localhost systemd[1]: Starting Initial cloud-init job (metadata service crawler)...
Mar 28 23:31:21 localhost cloud-init[754]: Cloud-init v. 0.7.9 running 'init' at Thu, 28 Mar 2019 23:31:21 +0000. Up 13.79 seconds.
Mar 28 23:31:21 localhost cloud-init[754]: ci-info: ++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++
Mar 28 23:31:21 localhost cloud-init[754]: ci-info: +--------+------+--------------+---------------+-------+-------------------+
Mar 28 23:31:21 localhost cloud-init[754]: ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
Mar 28 23:31:21 localhost cloud-init[754]: ci-info: +--------+------+--------------+---------------+-------+-------------------+
Mar 28 23:31:21 localhost cloud-init[754]: ci-info: | lo: | True | 127.0.0.1 | 255.0.0.0 | . | . |
Mar 28 23:31:21 localhost cloud-init[754]: ci-info: | lo: |
Cloud-init v. 0.7.9 running 'init-local' at Thu, 28 Mar 2019 19:31:38 +0000. Up 8.37 seconds.
2019-03-28 19:31:38,705 - __init__.py[WARNING]: apply_network_config is not currently implemented for distribution '<class 'cloudinit.distros.nixos.Distro'>'. Attempting to use apply_network
2019-03-28 19:31:38,712 - stages.py[WARNING]: distro '<cloudinit.distros.nixos.Distro object at 0x7ff6e57bda90>' does not implement apply_network_config. networking may not be configured properly.
Cloud-init v. 0.7.9 running 'init' at Thu, 28 Mar 2019 19:31:43 +0000. Up 13.14 seconds.
ci-info: +++++++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++++++
ci-info: +--------+------+----------------+---------------+-------+-------------------+
ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
ci-info: +--------+------+----------------+---------------+-------+-------------------+
ci-info: | lo: | True | 127.0.0.1 | 255.0.0.0 | . | . |
ci-info: |
-- Logs begin at Thu 2019-03-28 13:10:39 UTC, end at Thu 2019-03-28 13:21:32 UTC. --
Mar 28 13:10:47 localhost systemd[1]: Starting Initial cloud-init job (metadata service crawler)...
Mar 28 13:10:47 localhost cloud-init[743]: WARN: no logging configured! (tried 0 configs)
Mar 28 13:10:47 localhost cloud-init[743]: Setting up basic logging...
Mar 28 13:10:47 localhost cloud-init[743]: Cloud-init v. 0.7.9 running 'init' at Thu, 28 Mar 2019 13:10:47 +0000. Up 12.66 seconds.
Mar 28 13:10:47 localhost cloud-init[743]: 2019-03-28 13:10:47,975 - util.py[DEBUG]: Cloud-init v. 0.7.9 running 'init' at Thu, 28 Mar 2019 13:10:47 +0000. Up 12.66 seconds.
Mar 28 13:10:47 localhost cloud-init[743]: 2019-03-28 13:10:47,981 - util.py[DEBUG]: Writing to /var/log/cloud-init.log - ab: [420] 0 bytes
Mar 28 13:10:47 localhost cloud-init[743]: 2019-03-28 13:10:47,985 - util.py[DEBUG]: Changing the ownership of /var/log/cloud-init.log to 0:55
Mar 28 13:10:47 localhost cloud-init[743]: 2019-03-28 13:10:47,985 - util.py[DEBUG]: Runn

Keybase proof

I hereby claim:

  • I am eamsden on github.
  • I am eamsden (https://keybase.io/eamsden) on keybase.
  • I have a public key whose fingerprint is 4553 4C1E 319C 894F E255 6B79 876C B0F0 F986 0099

To claim this, I am signing this object: