navm 0.2.4

A simple VM intended to be used in scripting languages


To use this package, run the following command in your project's root directory:

A VM designed to be fast, intended for use in scripting languages.

It's sometimes written navm instead of NaVM, both are the same

Getting Started

These instructions will get you a copy of NaVM with its very basic instuctions, which will serve as a demo. Remember, NaVM is not built to be a standalone application, it's meant to be used as a library (originally built for QScript, but everyone's free to use it).

See source/app.d to see how to add external functions, and use it in your program.

See spec/syntax.md and spec/instructions.md for NaVM's syntax and a list of instructions you can use.

See examples/* for some example byte codes. These can be run using the demo build.

Prerequisites

You need to have these present on your machine:

  1. dub
  2. dlang compiler (only dmd is tested)
  3. Internet connection (for dub to fetch NaVM and its dependencies)

Building

Run:

dub fetch navm

to download this package, and then run:

dub build navm -b=release -c=demo

to fetch dependencies and build NaVM. Following this, you will have the NaVM binary (named demo) with very basic functionality.

You can now run NaVM bytecode using:

~/.dub/packages/navm-*/navm/demo path/to/bytecodefile

This binary also has 4 external functions:

  • ID: 0, call using `ExecuteFunctionExternal 0 n` where n is number of integers to pop from stack and writeln(int) to terminal
  • ID: 1, call using `ExecuteFunctionExternal 1 n` where n is number of doubles (floats) to pop from stack and writeln(double) to terminal
  • ID: 2, call using `ExecuteFunctionExternal 2 n` where n is number of strings to pop from stack and write to terminal
  • ID: 3, call using `ExecuteFunctionExternal 3 0` reads a line from stdin, pushes it to stack

License

NaVM is licensed under the MIT License - see LICENSE for details

Authors:
  • Nafees
Dependencies:
utils
Versions:
0.2.4 2020-Apr-04
0.2.3 2020-Feb-09
0.2.2 2020-Jan-30
0.2.1 2020-Jan-24
0.2.0 2020-Jan-19
Show all 13 versions
Download Stats:
  • 1 downloads today

  • 2 downloads this week

  • 4 downloads this month

  • 23 downloads total

Score:
0.9
Short URL:
navm.dub.pm