Gate

Run untrusted code from anonymous sources. Instead of sending messages composed of passive data, send programs which can react to their environment. Migrate or duplicate running applications across hosts and computer architectures. See Introduction to Gate.

Foundations

WebAssembly is the interchange format of the user programs. However, the APIs are different from the browsers' usual WebAssembly environments. See low-level C API or the higher-level Rust crate for details.

The sandboxing and containerization features of the Linux kernel provide layers of security in addition to WebAssembly. See Security for details.

Gate services are akin to syscalls, but they work differently. New services can be added easily, and available services are discovered at run time. See Service implementation for details.

Building blocks

Gate appears as Go packages and programs. The execution mechanism is implemented in C++ and assembly. It is highly Linux-dependent. x86-64 and ARM64 are supported.

Important Go packages:

See the complete list of Go packages.

Programs:

The available services are determined by what is built into the gate-daemon and gate-server programs. The versions provided by this Go module include only the services implemented in this repository. See extension about bundling additional services.

Objectives

While code is data, most of the time data cannot be treated as code for safety reasons. Change that at the Internet level. Data encapsulated in code can describe and transform itself.

Application portability. Migrate processes between mobile devices and servers when circumstances change: user presence, resource availability or demand, continuity etc.

Overhead needs to be low enough so that the system can be practical. Low startup latency for request processing. Low memory overhead for high density of continually running programs.

Work in progress

User program support:

Requirements and build instructions

Run-time dependencies:

There are two approaches to building Gate: the normal Go way, or via the make.go build system.

Normal build using Go

The Gate programs can be built normally using the Go toolchain:

go install gate.computer/cmd/gate@latest
go install gate.computer/cmd/gate-daemon@latest
go install gate.computer/cmd/gate-runtime@latest
go install gate.computer/cmd/gate-server@latest

Go 1.21 is required.

Gate runtime needs to execute some separately built binaries. To make the built Go programs self-contained, pre-built binaries are bundled into them by default. The pre-built binary files are under version control, and can be rebuilt using go generate. To disable bundling of pre-built binaries, specify -tags=gateexecdir for the Go build command, and use make.go to build and install them separately.

Build everything using make.go

Build targets:

Build requirements:

Test requirements:

Installation

The build system builds a standalone installer which can be invoked as root:

  1. go run make.go or go run make.go installer ...
  2. sudo bin/install

See also