All Projects → divs1210 → Impala

divs1210 / Impala

Licence: WTFPL license
Simple, extensible bytecode interpreter

Programming Languages

clojure
4091 projects
shell
77523 projects

Projects that are alternatives of or similar to Impala

RISVM
A low overhead, embeddable bytecode virtual machine in C++
Stars: ✭ 21 (-19.23%)
Mutual labels:  vm, bytecode-interpreter
magento2-ansible-vagrant
Ⓜ️2️⃣ Ansible provisioned Ubuntu 16.04 vagrant box for Magento2 development.
Stars: ✭ 25 (-3.85%)
Mutual labels:  vm
vm-rpc
Discord RPC for VMs.
Stars: ✭ 38 (+46.15%)
Mutual labels:  vm
Tagha
Minimal, low-level, fast, and self-contained register-based bytecode virtual machine/runtime environment.
Stars: ✭ 101 (+288.46%)
Mutual labels:  vm
Proxmox
Proxmox Helper Scripts
Stars: ✭ 3,882 (+14830.77%)
Mutual labels:  vm
browser-vm
A small Linux x86 VM meant for use in the browser
Stars: ✭ 122 (+369.23%)
Mutual labels:  vm
Graal
GraalVM: Run Programs Faster Anywhere 🚀
Stars: ✭ 16,272 (+62484.62%)
Mutual labels:  vm
UTM
Virtual machines for iOS and macOS
Stars: ✭ 16,904 (+64915.38%)
Mutual labels:  vm
neos
Language agnostic scripting engine with a custom bytecode JIT
Stars: ✭ 36 (+38.46%)
Mutual labels:  vm
uvm
Universal Virtual Machine for Node and Browser
Stars: ✭ 29 (+11.54%)
Mutual labels:  vm
Velocity
🚀Velocity template engine for JavaScript and PHP.
Stars: ✭ 33 (+26.92%)
Mutual labels:  vm
cb-tumblebug
Cloud-Barista Multi-Cloud Infra Management Framework
Stars: ✭ 33 (+26.92%)
Mutual labels:  vm
specter
a (tiny) VM project built with Go
Stars: ✭ 57 (+119.23%)
Mutual labels:  vm
drupalci-sonar-jenkins
DEPRECATED - Drupal CI environment with SonarQube and Jenkins for Drupal Core code analysis.
Stars: ✭ 40 (+53.85%)
Mutual labels:  vm
Dictu
Dictu is a high-level dynamically typed, multi-paradigm, interpreted programming language.
Stars: ✭ 191 (+634.62%)
Mutual labels:  bytecode-interpreter
Senegal
Senegal programming language
Stars: ✭ 116 (+346.15%)
Mutual labels:  vm
cikit
Continuous Integration Kit (CIKit)
Stars: ✭ 21 (-19.23%)
Mutual labels:  vm
pocketlang
A lightweight, fast embeddable scripting language.
Stars: ✭ 1,412 (+5330.77%)
Mutual labels:  vm
AlchemyVM
WebAssembly Virtual Machine Built In Elixir
Stars: ✭ 184 (+607.69%)
Mutual labels:  vm
quickjs-build
Build for QuickJS JavaScript Engine
Stars: ✭ 25 (-3.85%)
Mutual labels:  vm

Impala

Simple, extensible bytecode interpreter

Impala is a simple bytecode interpreter written in Clojure. Written to learn from and to teach making use of.

Usage

Load everything into namespace.

(use '[impala core lib])

Write a simple program in impala bytecode and execute it, printing the whole lifecycle to stdout.

(let [prog [[SET :a  5]
            [SET :b  3]
            [ADD :a :b]]]
  (run prog true))

We can even extend the instruction set by defining our own opcodes

  • in Clojure
(defn ADD
  "b := b + a"
  [env a b]
  (swap! env update-in [:vars b] + (-> @env :vars a)))

or

  • in Impala byte code!
;; from impala.lib
(defop ADD
  "b := b + a"
  [a b] [Z]
  (SUB a Z)
  (SUB Z b))

At the heart of this capability is the SUBLEQ primitive, which is Turing Equivalent.

In this example, Z is a temporary register created (and set to 0) every time ADD is called, and deleted once it's done executing. An opcode may use multiple temporary registers.

Standalone Interpreter

At the terminal, run

lein uberjar

./impala test/impala/test.imp

License

Impala is licensed under wtfpl and is effectively in the public domain.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].