Skip to content

c-shinkle/monkey-lang-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monkey Lang, implemented in Zig!

Monkey Logo

Monkey is a programming language built by hand, solely for educational purposes. If you are interested in learning how to write a language yourself, please check out this link for more information.

Features

Monkey includes:

  • integers
  • booleans
  • strings
  • functions as expressions (closures)
  • if-else control flow
  • implicit and explicit returns

Build Instructions

First, you must install Zig. You can find instructions here.

Next, run:

zig build install

This will compile the source code into an executable. It can be found at zig-out/bin/monkey-lang. You can execute it in a terminal, and it will launch into an interactive REPL. As a shortcut to compile and launch into the REPL directly, run:

zig build run

If you want to use a file for your input, simply add a relative path to the file as a CLI argument:

zig-out/bin/monkey-lang input.txt

The same shortcut can be used for files:

zig build run -- input.txt

Advanced Use Case

For user who want an improved user experience, you can link the GNU Readline library into the REPL by adding the -Denable_readline flag:

zig build run -Denable_readline

You can find GNU Readline library instructions here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages