VeloxVM is a safe, portable execution environment for applications on resource-constrained Internet of Things (IoT) devices. It runs alongside a host operating system and provides facilities often unavailable on small devices, including high-level languages, preemptive multithreading, exception handling, resource provisioning, and security policies. VeloxVM can operate on devices with as little as 32 kB RAM and 256 kB ROM.
Applications can be written in Scheme or Python. The Scheme frontend supports most of R5RS with extensions for networking and common IoT operating-system services. The Python frontend supports a practical subset of Python and compiles it to the same runtime format.
Both frontends produce compact VeloxVM bytecode. The 208-instruction format reduces the storage and radio-transfer costs of deploying applications to constrained devices.
- POSIX systems such as Linux, BSD, macOS, and Windows with Cygwin
(
ports/posix) - Contiki-NG (
ports/contiki-ng)
Install the build dependencies listed below, then build the VM and compile an example:
make
./compile.sh basic/factorial
./run.sh basic/factorialRun ./compile.sh without an application name to compile all applications and
benchmarks. Build products are written to a bin/ directory beside their
source category; for example, apps/basic/factorial.scm becomes
apps/basic/bin/factorial.vm.
A prebuilt Linux/AMD64 image is published on Docker Hub:
docker pull nvt1/veloxvm:latest
docker run --rm nvt1/veloxvm:latest \
bin/vm apps/basic/bin/factorial.vmThe image contains the VM, compiler toolchains, repository sources, and compiled example applications. To explore the image interactively, start a shell:
docker run --rm -it nvt1/veloxvm:latest bashTo build the image locally from the repository instead:
docker build -f tools/docker/Dockerfile -t veloxvm .To build the VM and its tools, install:
- Bison
- Flex
- Clang or GCC
- Make
- Racket 8.0 or later (for the Scheme compiler)
- Python 3 (for the Python compiler and test utilities)
Some test suites have additional dependencies. See Testing.
Applications may be written in Scheme (.scm) or Python (.py). The compiler
selects the frontend from the file extension.
./compile.sh # compile all apps and benchmarks
./compile.sh algorithms/sieve.py # compile one source file
./compile.sh -f basic/factorial # force recompilation
./run.sh algorithms/sieve # locate and run compiled bytecode
bin/vm apps/algorithms/bin/sieve.vm # invoke the VM directlySee apps/README.md for the example layout and
doc/scheme.md or doc/python.md for
language-specific guidance.
Test suites are grouped by purpose and can be run independently:
tests/unit-tests/run-tests.sh
tests/primitives/run-tests.sh
tests/python-tests/run-tests.sh
tests/multi-app/run-tests.shFunctional tests require Python 3 and Pexpect. Fuzzing additionally requires
American Fuzzy Lop (afl-fuzz). See tests/README.md.
The Contiki-NG port has separate setup and firmware instructions in
ports/contiki-ng/README.md.
The main guides and references are:
- Scheme guide and R5RS compliance
- Python frontend
- Primitive table and instruction-set reference
- Bytecode format
- Interactive REPL
The original Scheme compiler is preserved under
languages/scheme-cl-legacy/ for historical reference. It emits bytecode
format version 1 and only works with VeloxVM at commit 6f3c0a3 (the last v1
commit) or earlier. It is not part of the active build; see that directory's
README for details.
-
N. Tsiftes and T. Voigt. Velox VM: A safe execution environment for resource-constrained IoT applications. Journal of Network and Computer Applications, Volume 118, pages 61-73. 2018.
-
N. Tsiftes. Storage-Centric System Architectures for Networked, Resource-Constrained Devices. Digital Comprehensive Summaries of Uppsala Dissertations from the Faculty of Science and Technology 1331. Uppsala: Acta Universitatis Upsaliensis. 2016.