What Yoke is
Yoke is a runtime for applications whose logic is split across several programs running on one machine, and that are used through more than one interface at once. You write the programs that hold the logic. Yoke launches them, watches them, carries their traffic and keeps their state. It also publishes one contract through which any interface reaches them: a panel on the device's own screen, a browser on its network port, a desktop application, or a command-line tool.
It comes in two forms that share one runtime. The first, Yoke Service, is a system installation, started by the init system the way any service on a Linux device is. The second, Yoke Application, is a self-contained application, one file that a user installs and runs as many times as they need, with no privilege at all. Which one you use is a decision about deployment; the programs you write are the same in both (plugins and applications).
The kind of application it is for
Think of the software that sits in front of a piece of hardware or a site:
- the front end of a laboratory instrument;
- the dashboard of a machine on a factory floor;
- an appliance installed at a customer's;
- an edge gateway;
- the administration tool for any of these.
These applications look different, and they are built from the same parts every time:
- some code that talks to the hardware or holds the domain logic;
- something that starts that code and restarts it when it falls;
- a way for a screen to ask it questions and follow what it produces;
- authentication;
- a log;
- sooner or later, a second interface. A browser for the service technician, or a command-line tool for the integrator, beside the panel the operator touches.
A concrete case runs through the reference: a spectrometer station. One program drives the spectrometer over a serial line and publishes the spectra it reads. A second identifies what a spectrum shows. A third archives the datasets. A fourth is the panel on the instrument's own screen. A service technician opens the same station from a browser over the network. When the technician takes control, the panel yields, is told so, and gets control back when the technician leaves. The station is described from end to end in a walk through the example.
The problem it removes
The cost of such an application is not in any one of its parts; it is in reassembling them every time. Each project rewrites process supervision, an event channel and an authentication step, at the quality of whoever was available that week. The contract between the screen and the logic is written down nowhere except in the two bodies of code that must honour it, so the two drift apart. And "we also need a browser version" becomes a new project rather than a new view, because the contract has to be built again before anything can be drawn.
There is a second, less visible cost. Splitting logic into separate processes is the right thing to do on a device:
- a crash in the code that drives the hardware does not take the screen with it;
- the part that touches a device can be isolated from the rest;
- each part can be written in the language that suits it.
Today, though, splitting usually means adopting the machinery of distributed systems: discovery, sidecars, a service mesh, a control plane. That price makes sense on a hundred machines and none on one, where the operating system already isolates, supervises and connects processes. Many projects stay monolithic to avoid paying it.
Yoke's answer is that the repeated parts are infrastructure, and that isolation on one host should cost what one host costs. Supervision, lifecycle, authentication, the record of what is installed and what is allowed, and the fan-out of the same data to several interfaces are written once, in Yoke.
What you write, and what you are given
You write the units: the programs that hold your application's logic. Most are Plugins, long-running programs that answer questions, accept commands and publish streams of data. Some run once and exit, to prepare something before the others start. Some are the interfaces themselves, a panel for instance, which Yoke starts and supervises like any other unit. You write them in Go, Rust, Python, C or C++, with a library for each language (what each family offers).
You describe how they fit together. The description says which units the application runs, with
which arguments, which interfaces it offers and how each is reached, and which interface prevails when
two of them want control. The composer, yoke-compose, writes that description with you and checks it
as you go. It then builds the package that carries the application to a host.
Everything else is Yoke's:
- launching each unit with exactly what it needs, and nothing more;
- admitting it only if it is the program it claims to be and the operator has allowed what it does;
- restarting it according to a policy;
- carrying a question from a browser to the unit that answers it;
- opening a stream when an interface asks for one, and closing it when nobody is reading;
- keeping each unit's output in a log you can query;
- recording who allowed what and when;
- telling every interface what changed.
Your logic is reachable from every interface, and you write none of the interfaces' plumbing to make it so. A unit you have written appears in a browser, on a panel and on the command line without a line of it changing. The interfaces you write yourself are clients of a published contract: the interfaces shipped with Yoke use the same contract, with no shortcut of their own.
What it is not
The negative definition matters as much as the positive one. If your problem is one of the following, Yoke is the wrong tool, and it will not grow into the right one:
| Yoke is not | Which means |
|---|---|
| a distributed runtime | one host, by choice: no clustering, no failover, no horizontal scaling. State is a local file with a single writer |
| a data-flow orchestrator | there is no pipeline language and no graph of sources and sinks. Units answer, act and publish; what flows between them is yours |
| a web framework | no object mapping, no templating, no routing for your logic. A web page is a client like any other |
| a user-interface toolkit | Yoke opens the channel an interface uses and says nothing about how it is drawn, in which language, or with which framework |
| a general process manager | it supervises the units of its applications, and leaves everything else on the host to the init system |
| a multi-tenant platform | two applications of one account are not isolated from one another; two accounts are |
Three things are not promised either:
- Availability is the availability of one host and one process.
- A clean shutdown is never needed. A device loses power, and the next start reconciles whatever it finds.
- Not every path is reliable. Two paths drop data rather than wait: frames to a consumer that cannot keep up, and the live log feed to a slow reader. A panel that falls behind a fast stream loses frames, and the gap shows in their sequence numbers; it never slows the producer down.
Where to go next
- The architecture: the parts, and how a question travels through them.
- Building an application, to write one.
- Setting up Yoke, to get it onto a machine or into a device's image.