Skip to content

CharkPep/yami

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yami - Yet another monkey interpreter

Interpreter for monkey language described in Interpreter in Go by Thorsten Ball. Some features were added as monkey does not have essential features like assignments etc.

Build

go build -o monkey .

Run

# REPL
$ monkey

# Run on file
$ monkey ./example/fib.monkey

Example

// Fibonacci sequence
let n = 10;
let fib = fn (cur, prev, cur_n) {
    if cur_n == n {
        return cur
    }

    return fib(cur + prev, cur, cur_n + 1)
}
  
print(fib(0, 1, 0))

// expressions

let x = if !5 { print("hello world") }

print(x)

Check examples

About

Yami - Yet another monkey interpreter

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published