Skip to content

JonnyWalker81/monkey_interpreter

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

Rust implmentation of an interpreter for the Monkey programming language. Following the book Writing an Interpreter in Go.

Below is an example of the Monkey Language:

let myVar = 1
myVar;

let age = 1;
let name = "Monkey";
let result = 10 * (20 / 2);

let myArray = [1, 2, 3];

let fibonacci = fn(x) {
      if (x == 0) {
          0
      } else {
          if (x == 1) {
              1
          } else {
            fibonacci(x - 1) + fibonacci(x - 2);
          }
      }
  };
  
let twice = fn(f, x) {
  return f(f(x));
};

let addTwo = fn(x) {
  return x + 2;
};

twice(addTwo, 2); // => 6

About

Monkey Interpreter written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages