Programs written to run on conventional operating systems
typically depend on OS abstractions like processes, pipes,
signals, sockets, and a shared file system. Compiling
WebAssembly with tools like
isn’t enough to successfully run many programs client-side,
as browsers present a non-traditional runtime environment
that lacks OS functionality. Porting these applications to
the web currently requires extensive rewriting or paying to
host significant portions of code in the cloud.
Browsix is our answer to these challenges, featuring:
Unmodified C, C++, Go, and Node.js programs run as
processes on Web Workers, executing in-parallel with
the main browser thread – no need to worry about
long-running computations blocking event-handling or
Kernel + System Calls
By working at the lowest levels of abstraction, Browsix
provides shared resources to multiple language
runtimes, just as traditional operating systems enable
running programs written in a host of languages.
By enabling a large class of programs (including legacy
codebases) to run in-browser, Browsix can free you from
the chore of sandboxing and load-balancing programs
A Unix terminal exposing the dash POSIX shell lets
developers compose functionality and inspect Browsix state
in a familiar way. (view source)
In-browser editor that runs pdflatex and bibtex to
generate PDFs. Required (view source)
Browsix is a framework that bridges the considerable gap
between conventional operating systems and the browser,
enabling unmodified programs expecting a Unix-like
environment to run directly in the browser. Browsix does
this by mapping low-level Unix primitives, like processes and
system calls, onto existing browser APIs, like
Browsix brings all of these abstractions into unmodified browsers,
and is isolated and secured to the same extent any normal web
page is: at the level of the browser tab.
instance of a Browsix kernel (which involves telling it how
to initialize the filesystem), and then asks the kernel to
start or kill processes. Users can also perform HTTP
requests to a given Browsix TCP port, and register callbacks
a number of events, like when a process has written to
standard out or standard error, for when processes exit, and
for when ports are ready.
Processes are built on top of Web Workers, letting
applications run in parallel and spawn
subprocesses. System calls include
kill(2)and signal handlers.
Shared Filesystem accessible from multiple processes.
Pipes are supported with
pipe(2)enabling developers to compose processes into pipelines.
Sockets include support for TCP socket servers and clients, making it possible to run applications like databases and HTTP servers together with their clients in the browser.
Browsix comprises two core parts:
We will soon have more push-button instructions for
integrating Browsix into your project. For now, check out
GitHub for more details.