Giter VIP home page Giter VIP logo

kineticvm's Introduction

KineticVM is a bytecode assembler and toy virtual machine for a transport-triggered architecture. In other words, it simulates a register machine whose only instruction is "move." All other operations are performed through special system registers.

For instance, the following KineticVM assembly code prints the sum of 2 and 3:

; Move the constant "2" into the system register LHS
2 -> %LHS
; Move the constant "3" into the system register RHS.
3 -> %RHS
; The value of the SUM register is always equal to the sum of LHS and RHS.
; Here, therefore, it contains the number 5. 
; Moving a value into the system register OUT prints it to the screen.
; So moving SUM to OUT will print the number 5:
%SUM -> %OUT

If this code is saved in test.s, one can assemble and execute it with the following commands:

$ cargo build
$ ./target/debug/kineticvm assemble test.s > test.o
$ ./target/debug/kineticvm execute test.o
5

Documentation

Documentation for the full architecture is available on the wiki. More code samples, with corresponding expected output, are contained in the tests directory.

The codebase itself is not fully documented at the moment, but rustdoc documentation can be generated with ./generate-docs.sh (currently tested only on Linux).

Future Plans

User-facing

  • Add more documentation (see above).
  • Make the assembler and CLI simpler and more user-friendly (perhaps splitting the assembler and the VM into separate binaries).
    • One issue: assembler can't handle comments at EOF.
  • Write more complex tests. This may inspire new features.

Architecture

  • Numerical input
  • Support for read-only data (like .data)
  • Rename (or alter the behavior of) existing registers for simplicity &c. and make sure all registers are documented on the wiki

Internals

  • Implement a proper garbage collector. Currently, the VM distinguishes between two types (integers and pointers); this feature should allow for precise collection.
  • Create an integrated JIT compiler. It may be useful to have an LLVM backend, like the one included in HHVM.

Future directions

  • Write a compiler for a (reasonably) high-level language that targets KineticVM.

kineticvm's People

Contributors

jasonhansel avatar

Stargazers

0x44 0x46 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.