wanix

package module
v0.0.0-...-4cb4b50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: MIT Imports: 12 Imported by: 1

README

Wanix

Discord GitHub Sponsors

A virtual environment toolkit for the web, inspired by Plan 9.

📺 Wanix: The Spirit of Plan 9 in Wasm

  • Run WASI and x86 programs on web pages
  • Apply Plan 9 ideas in the browser
  • Build a web-native operating system
Features
  • Capability-oriented microkernel architecture ("everything is a file")
  • Abstract POSIX process model for generalized compute execution
  • Per-process namespaces for security, isolation, and custom environments
  • Built-in emulator for x86 support and Linux compatibility

Try online demo

Play with the Wanix shell bundle at wanix.run.

Install the Wanix Toolchain

Download the Wanix CLI from the latest release or install with Homebrew:

brew install progrium/taps/wanix

If you want to build from source, see the CONTRIBUTING.md doc.

File Services

Wanix has a number of built-in file services:

  • #task
  • #term
  • #vm
  • #ramfs
  • #pipe
  • #signal
  • #web
  • #wanix
API Reference

For now, see api/ and api/handle.js.

Contributing

We'd love your contributions! Take a look at our issues to see how you can help out. You can also ask questions and participate in discussions, however right now most discussion takes place in our Discord.

Be sure to read our CONTRIBUTING.md doc to get started.

Older Demos

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ControlFile = misc.ControlFile
View Source
var FieldFile = misc.FieldFile
View Source
var (
	TaskContextKey = &contextKey{"task"}
)
View Source
var Version string

Functions

func Export

func Export(t *Task, export fs.FS)

func GetWorker

func GetWorker(t *Task) any

func SetWorker

func SetWorker(t *Task, worker any)

Types

type Factory

type Factory func(id, kind string) Resource

type Resource

type Resource interface {
	fs.FS
	ID() string
}

type Task

type Task struct {
	// contains filtered or unexported fields
}

func FromContext

func FromContext(ctx context.Context) (*Task, bool)

func NewRoot

func NewRoot() (*Task, error)

func NewRootWithTasks

func NewRootWithTasks(t *TaskFS) (*Task, error)

func (*Task) Alias

func (r *Task) Alias() string

func (*Task) Arg

func (r *Task) Arg(idx int) string

func (*Task) Bind

func (r *Task) Bind(srcPath, dstPath string) error

func (*Task) CloseFD

func (r *Task) CloseFD(fd int) error

func (*Task) Cmd

func (r *Task) Cmd() string

func (*Task) Context

func (r *Task) Context() context.Context

func (*Task) Dir

func (r *Task) Dir() string

func (*Task) Env

func (r *Task) Env() []string

func (*Task) Export

func (r *Task) Export() (fs.FS, error)

func (*Task) FD

func (r *Task) FD(fd int) (fs.File, string, error)

func (*Task) ID

func (r *Task) ID() string

func (*Task) Lookup

func (t *Task) Lookup(rid string) (*Task, error)

func (*Task) NS

func (r *Task) NS() *vfs.NS

func (*Task) Open

func (r *Task) Open(name string) (fs.File, error)

func (*Task) OpenContext

func (r *Task) OpenContext(ctx context.Context, name string) (fs.File, error)

func (*Task) OpenFD

func (r *Task) OpenFD(file fs.File, path string) int

func (*Task) Parent

func (r *Task) Parent() *Task

func (*Task) Register

func (t *Task) Register(kind string, driver TaskDriver)

kludge: this would imply task specific registration, but its global. this is until we have a better registration system.

func (*Task) ResolveFS

func (r *Task) ResolveFS(ctx context.Context, name string) (fs.FS, string, error)

func (*Task) Root

func (r *Task) Root() *Task

func (*Task) Start

func (t *Task) Start() error

func (*Task) Tasks

func (t *Task) Tasks() (tasks []*Task)

func (*Task) Unbind

func (r *Task) Unbind(srcPath, dstPath string) error

type TaskDriver

type TaskDriver interface {
	Check(*Task) bool
	Start(*Task) error
}

type TaskFS

type TaskFS struct {
	// contains filtered or unexported fields
}

func NewTaskFS

func NewTaskFS() *TaskFS

func (*TaskFS) Alloc

func (d *TaskFS) Alloc(kind string, parent *Task) (*Task, error)

func (*TaskFS) Lookup

func (t *TaskFS) Lookup(rid string) (*Task, error)

func (*TaskFS) Open

func (d *TaskFS) Open(name string) (fs.File, error)

func (*TaskFS) OpenContext

func (d *TaskFS) OpenContext(ctx context.Context, name string) (fs.File, error)

func (*TaskFS) Register

func (d *TaskFS) Register(kind string, driver TaskDriver)

func (*TaskFS) ResolveFS

func (d *TaskFS) ResolveFS(ctx context.Context, name string) (fs.FS, string, error)

func (*TaskFS) Stat

func (d *TaskFS) Stat(name string) (fs.FileInfo, error)

func (*TaskFS) StatContext

func (d *TaskFS) StatContext(ctx context.Context, name string) (fs.FileInfo, error)

Directories

Path Synopsis
cmd
wanix command
gojs-export command
repl-gojs command
extras
hostexport command
wexec command
fs
cowfs
Package cowfs implements a copy-on-write filesystem that combines a read-only base filesystem with a writable overlay filesystem.
Package cowfs implements a copy-on-write filesystem that combines a read-only base filesystem with a writable overlay filesystem.
httpfs/fstest command
tarfs
tarfs implements a read-only in-memory representation of a tar archive
tarfs implements a read-only in-memory representation of a tar archive
vfs
shlex
Package shlex provides a simple lexical analysis like Unix shell.
Package shlex provides a simple lexical analysis like Unix shell.
shm
test
gojs command
wasi/golang command
wasi/tinygo command
web
caches
Package caches provides a filesystem that exposes the browser's Cache API.
Package caches provides a filesystem that exposes the browser's Cache API.
dl
dom
fsa
File System Access API
File System Access API
sw
sys

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL