All Projects → poteto → monkers

poteto / monkers

Licence: MIT License
Bytecode compiler and VM for the Monkeylang language, written in Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to monkers

boba-js
Toy programming language. Now being reimplemented in Rust: https://github.com/poteto/monkers
Stars: ✭ 22 (-35.29%)
Mutual labels:  interpreter, monkey-language
monkey
The Monkey Programming Language & Interpreter written in PHP.
Stars: ✭ 21 (-38.24%)
Mutual labels:  interpreter, monkey-language
clyde
Dialogue language and tools for games.
Stars: ✭ 21 (-38.24%)
Mutual labels:  interpreter
termission
Cross-platform Serial (COM Port) / TCP Terminal with Scriptable Auto-Response
Stars: ✭ 39 (+14.71%)
Mutual labels:  interpreter
wazm
Web Assembly Zig Machine
Stars: ✭ 54 (+58.82%)
Mutual labels:  interpreter
snap
An embeddable scripting language inspired by Lua and JavaScript.
Stars: ✭ 32 (-5.88%)
Mutual labels:  interpreter
js-slang
Implementations of the Source languages, which are small sublanguages of JavaScript designed for SICP JS
Stars: ✭ 41 (+20.59%)
Mutual labels:  interpreter
lust
A parser, compiler, and virtual machine evaluator for a minimal subset of Lua; written from scratch in Rust.
Stars: ✭ 120 (+252.94%)
Mutual labels:  interpreter
free-monads-functional-web-apps
Delving into Free Monads and using them to write pure functional web applications
Stars: ✭ 18 (-47.06%)
Mutual labels:  interpreter
dragon
🐲 Object orientated, dynamically typed, interpreted programming language inspired by Python and Javascript.
Stars: ✭ 14 (-58.82%)
Mutual labels:  interpreter
oxide-lang
Oxide Programming Language, an interpreted scripting language with a Rust influenced syntax.
Stars: ✭ 106 (+211.76%)
Mutual labels:  interpreter
computation-py
Python implementation for Understanding Computation book.
Stars: ✭ 22 (-35.29%)
Mutual labels:  interpreter
esoo
Like the Programming Languages Zoo but with esoteric languages.
Stars: ✭ 18 (-47.06%)
Mutual labels:  interpreter
aria
Expressive, noiseless, interpreted, toy programming language
Stars: ✭ 40 (+17.65%)
Mutual labels:  interpreter
js-ziju
Compile javascript to LLVM IR, x86 assembly and self interpreting
Stars: ✭ 112 (+229.41%)
Mutual labels:  interpreter
hematita
A memory safe Lua interpreter
Stars: ✭ 118 (+247.06%)
Mutual labels:  interpreter
tranquility
Tranquility is an in-development programming language intended to replace Solidity
Stars: ✭ 17 (-50%)
Mutual labels:  interpreter
go-jdk
Run JVM-based code in Go efficiently
Stars: ✭ 61 (+79.41%)
Mutual labels:  interpreter
cosy
A simple and pleasant programming language.
Stars: ✭ 21 (-38.24%)
Mutual labels:  interpreter
chickadee
Chickadee is a minimal programming language implemented in TypeScript for teaching purposes.
Stars: ✭ 13 (-61.76%)
Mutual labels:  interpreter

monkers 🐒 + 🦀

Rust

Short for monkey-rs. An implementation of monkeylang. Previously, I implemented the interpreter in TypeScript. I am re-implementing the interpreter and later compiler in Rust as a learning exercise.

Building

$ cargo build --release

# See help
$ target/release/monkers --help

# Run the REPL with bytecode compilation
$ target/release/monkers

# Run the REPL with the tree-walking interpreter
$ target/release/monkers -s interpreted

Developing

Development REPL

Start the REPL by running cargo run, then entering some Monkey:

🐒 >> let a = 5;
5
🐒 >> let b = a > 3;
true
🐒 >> let c = a * 99;
495
🐒 >> if (b) { 10 } else { 1 };
10
🐒 >> let d = if (c > a) { 99 } else { 100 };
99
🐒 >> d;
99
🐒 >> d * c * a;
245025

Options can also be enabled:

$ cargo run -- -d               # debug mode
$ cargo run -- -s interpreted   # eval with interpreter

Command history is saved in history.txt.

By default, monkers REPL will compile your code into bytecode, then evaluate the bytecode with its VM. You can switch to the slower tree-walking interpreter with an arg:

cargo run -- interpreted

Helpful crates

cargo-watch

cargo-watch watches over your Cargo project's source. I use it to run my tests and cargo check whenever a file changes. It's aliased to cargo dev, which expands to:

cargo watch -x check -x test

Optionally you can append the RUST_BACKTRACE=1 flag to get backtraces.

Contributing

PRs are welcome! I am not a Rust expert, so I welcome any recommendations on more idiomatic Rust code.

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].