Skip to content

jnsahaj/monkey-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Interpreter for monkey, written in Rust

Inspired by Thorsten Ball's interpreterbook.com "Writing an Interpreter in Go" where he writes a tree-walking Interpreter from scratch using Go, without any third-party libraries, for a modern programming language "monkey".

This was my first exposure to Go, and one of my first major undertakings in Rust. While the primary goal was to get good at Rust, learning about how compilers and interpreters work has left me with profound knowledge applicable immediately.

This was also greatly helped by NathanYee's implementation of monkey in Rust, which served as my primary reference to translate Go patterns into Rust. Although, I have tried to improve upon it in modest ways.

List of features

  • Integers
  • Booleans
  • Strings
  • Arrays
  • HashMaps
  • Prefix-, Infix- and Index operators
  • Conditionals
  • Global and local bindings
  • First-class functions
  • Return statements
  • Closures

Usage

Start the REPL

~ cargo run

Run all tests

~ cargo test

About

An Interpreter written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages