Live Namespace Terminal
/mail.MaiLLM Wanix Example Namespace Last login: Sun May 19 04:17:33 1996 rc% ls -l drwxrwx--- 0 0 0 Dec 31 17:00 mail -rwxr-xr-x 0 0 0 Dec 31 17:00 rc.wasm rc% cat /mail/inbox/console-seven The archive terminal requires its local Wanix runtime. rc% _
Minimum Wanix Document
Facility purpose: Copy these tags into a new HTML file.
They assemble a tiny Unix for the Web, import the public MaiLLM
namespace, give an rc Task its /mail path,
and attach a live terminal. No MaiLLM-specific client is required.
Copy these tags
<!doctype html>
<script type="module"
src="https://cdn.jsdelivr.net/npm/wanix@0.4.0-rc2/dist/wanix.min.js">
</script>
<wanix-term cursor-blink>
<wanix-bind dst="." src="#ramfs/new"></wanix-bind>
<wanix-bind type="import" dst="remote"
src="wss://9p.maillm.dev/9p"></wanix-bind>
<wanix-bind type="file" dst="rc.wasm" perm="0755"
src="https://cdn.jsdelivr.net/npm/wanix-extras@0.4.0-rc2/dist/rc.wasm">
</wanix-bind>
<wanix-task cmd="rc.wasm" wd="/" term start>
<wanix-bind dst="mail" src="remote/mail"></wanix-bind>
</wanix-task>
</wanix-term>
- Save the source as
index.html. - Serve it over HTTP; module and Wasm files should not be opened through
file:. - Open the page and try
ls /mailandcat /mail/inbox/console-seven. - Change a source, add another bind, and make the environment your own.
Open the complete example page · Read about Wanix · Inspect the Wanix source
This minimum document also leaves the imported root available to the
Task as /remote. It demonstrates namespace composition,
not confinement.
This public example accepts well-formed Web page origins. Origin is not authentication; the service is anonymous, connection-local, bounded, and intended for experimentation.
How It Works (At a Glance)
remote/mail
/mail
This Task has been given one name from a remote filesystem. Within its namespace, that name is its authority.
The Wanix Ideas This Page Demonstrates
Wanix is an embeddable runtime that lets ordinary HTML declare a Unix-like environment in the browser. Its elements are small, orthogonal building blocks: compose names, bind resources, run programs, and attach whatever view the page needs. MaiLLM is one deliberately narrow example.
- 1. Everything is a file: different resources share one interface.
- Programs, terminals, storage, browser facilities, virtual machines, and remote services can appear as names in a filesystem. Programs use ordinary file operations instead of learning a client library for every resource.
- 2. Namespace: each Task receives its own view of those names.
- A namespace is not a single global disk. It is the tree of names visible to a particular Task. Two Tasks may run the same program while receiving different files, devices, and services.
- 3. Bind: compose an environment by giving resources local names.
-
A bind places a file, archive, browser facility, or another
namespace at a destination path. Here the page chooses to make the
remote service's
mailsubtree mean/mailto one Task. The service does not choose that local name. - 4. Task: run a program inside the environment you assembled.
- A Task is the process, and it owns its namespace. The terminal is merely a view attached to that Task; it does not own the process or its filesystem.
- 5. 9P: a namespace can cross a page or network boundary.
- Wanix can import a remote namespace over 9P. Ordinary programs then use open, read, write, and remove without needing a service-specific client library.
The page contains no MaiLLM-specific request code. It gives a Wanix
Task a name, then rc uses ordinary filesystem operations.
This is the Plan 9 idea, reintroduced as a Web primitive.
The shell makes the composition easy to inspect, but the terminal is not the point. The same assembled namespace can be used by a Wasm program, a JavaScript Task, a virtual machine, or a Workbench. The Wanix recipes and element reference continue from here.
Two Views of One Archive
MH-style complete messages and upas/fs expose the same
connection-owned archive in historically familiar places. They are
projections, not duplicate permanent stores.
/mail/
|-- inbox/{console-seven,...} 2-5 complete messages
|-- drafts/{cabinet-four,...} 2-5 complete messages
|-- archive/{tuesday-batch,...} 2-5 complete messages
`-- fs/mbox/console-seven/
|-- raw byte-identical to /mail/inbox/console-seven
|-- body
|-- from
|-- header
`-- subject
| Path | Historical arrangement | What a read returns |
|---|---|---|
/mail/{inbox,drafts,archive} |
MH-style mailbox | One complete RFC-style message per suggestive ASCII file |
/mail/fs |
Plan 9 upas/fs |
One directory per message, divided into useful fields |
Mounting the Facility
The Task begins at / with an empty local
/mail placeholder. After
deliberate activation, the remote mail subpath is bound
there in that same Task; its shell, terminal, prompt, and cursor remain
in place.
The endpoint is wss://9p.maillm.dev/9p, carrying ordinary
9P2000.L over a binary WebSocket.
ls /mail/inbox cat /mail/inbox/console-seven cat /mail/fs/mbox/console-seven/subject
Each connection receives a different archive. Reads consult the facility's records; writes, truncates, removes, and renames change only that connection's working copy. Refreshing or disconnecting ends the dream.
| Protocol | 9P2000.L over binary WebSocket |
|---|---|
| Activation | Deliberate on this page; declarative in copied Wanix pages |
| Mounted path | /mail |
| Read policy | Open world; hallucinatory |
| Write policy | Connection-owned; ephemeral |
| Availability | Public example service; refresh/disconnect ends the archive |
Questions for the Reader
- What remote service would become easier to compose if it arrived as a small filesystem?
- What is the smallest useful namespace you could give a Task, and which names would you withhold?
- Which resource could move from memory, to browser storage, to a remote service without changing the program that uses it?
- What could a Web page become if its HTML declared both the interface and the computing environment behind it?
Wanix is still an environment under exploration. The useful patterns are not presumed to have been exhausted.
Documents
- Wanix recipes, elements, and the Plan 9 talk
- Wanix source, quick start, and element reference
- Plan 9: The Use of Name Spaces in Plan 9
- Plan 9 Programmer's Manual
The terminal is the archive view. This document explains the facility; it does not browse the mail.