runtime.js
JavaScript library operating system for the cloud

Overview

runtime.js is an open-source library operating system for the cloud that runs JavaScript, could be bundled up with an application and deployed as a lightweight and immutable VM image.

It's built on V8 JavaScript engine and uses event-driven and non-blocking I/O model inspired by Node.js. At the moment KVM is the only supported hypervisor.

Example index.js:

var runtime = require('runtimejs')
console.log('Hello world!')

Let's bundle up and run it!

# install dependencies
npm install runtimejs
npm install runtimeify -g
npm install runtime-tools -g

# bundle up ramdisk image
runtimeify index.js -o initrd

# make sure you have QEMU installed
brew install qemu           # OSX
sudo apt-get install qemu   # Ubuntu

# run it in QEMU
runtime-qemu ./initrd

WARNING: project is in development and not ready for production use.

How does it work?

There are two main components: operating system (OS) kernel and a core JavaScript library.

The kernel is the C++ program that manages low-level resources like CPU and memory, runs applications using embedded V8 JavaScript engine, and exposes raw hardware to JavaScript.

Application, its dependencies and the core library are bundled up using Browserify, then packed into ramdisk image for kernel to use.

runtime.js is a library operating system, because application uses it as its own dependency (library). Internal architecture is similar to exokernels, where system exposes the hardware to application code and forces as few abstractions as possible.

Get Started ≫