Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gengjiawen/monkey-rust
A dancing with interpreter and compiler
https://github.com/gengjiawen/monkey-rust
compiler interpreter learning-by-doing monkey monkey-programming-language rust
Last synced: 5 days ago
JSON representation
A dancing with interpreter and compiler
- Host: GitHub
- URL: https://github.com/gengjiawen/monkey-rust
- Owner: gengjiawen
- License: mit
- Created: 2020-10-08T14:55:00.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-15T02:20:16.000Z (8 months ago)
- Last Synced: 2024-03-15T03:53:15.807Z (8 months ago)
- Topics: compiler, interpreter, learning-by-doing, monkey, monkey-programming-language, rust
- Language: JavaScript
- Homepage:
- Size: 3.69 MB
- Stars: 42
- Watchers: 2
- Forks: 5
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# monkey-rust
![Rust](https://github.com/gengjiawen/monkey-rust/workflows/Rust/badge.svg)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/?workspaceClass=g1-large&editor=code#https://github.com/gengjiawen/monkey-rust)
[![monkey-interpreter](https://img.shields.io/crates/v/monkey-interpreter)](https://crates.io/crates/monkey-interpreter)
[![npm version](https://img.shields.io/npm/v/@gengjiawen/monkey-wasm)](https://www.npmjs.com/package/@gengjiawen/monkey-wasm)An interpreter for the Monkey programming language written in Rust
![The Monkey Programming Language](https://cloud.githubusercontent.com/assets/1013641/22617482/9c60c27c-eb09-11e6-9dfa-b04c7fe498ea.png)
## What’s Monkey?
Monkey has a C-like syntax, supports **variable bindings**, **prefix** and **infix operators**, has **first-class** and **higher-order functions**, can handle **closures** with ease and has **integers**, **booleans**, **arrays** and **hashes** built-in.
Official site is: https://monkeylang.org/. It's has various implementation languages :).
There is a book about learning how to make an interpreter: [Writing An Interpreter In Go](https://interpreterbook.com/#the-monkey-programming-language). This is where the Monkey programming language come from.
## Features
- Split packages to make everything minimum
- **REPL**: A Read-Eval-Print-Loop (REPL) for Monkey tokenizer, parser, evaluator, compiler
- location info for ast
- test for every module
- **Wasm**: A WebAssembly target, thus run monkey on browser is directly supported.
- bytecode viewer from source### AST Online playground
https://astexplorer.net/#/gist/e23a81ce309e8fcffe95ddd1b5661061/01d0b4b078304ddd9639eae9f4e6d342e2b9d075### Compiler playground
https://gengjiawen.github.io/monkey-rust/## Instruction
### Build and test
```bash
$ cargo build
$ cargo test
```