Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 2.18 KB

README.md

File metadata and controls

65 lines (53 loc) · 2.18 KB

Monkeylang

This is a Rust implementation of the Monkey programming language created by Thorsten Ball. This is a fun project to learn more about interpreters and compilers and to learn the Rust Programming Language. The interpreter is written in pure Rust without any third party dependencies.

Playground

Run monkey code and discover all language features online in the wasm based playground. There are many examples that showcase all language features.

Disclaimer

The formatter is not quite there yet. It is time consuming to get the details right. I just wanted to see if my approach works. I will improve the formatter in the future.

CLI

You can use the monkey CLI to run and format monkey code locally. You can install it using cargo.

Install

Install the monkey cli with cargo:

$ git clone https://github.com/nilskch/monkeylang.git && cd monkeylang
$ cargo install --path cli
$ monkey --help
Use the monkey cli to run or format monkey code!

Usage: monkey [COMMAND]

Commands:
  run   Run monkey code from a file
  fmt   Format monkey code in a file
  help  Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Usage

Start the monkey repl:

$ monkey
Welcome to the Monkey Programming Language!
>> print("Hello World")
Hello World
>>

Run monkey code:

$ monkey run main.mky

Format monkey code:

$ monkey fmt main.mky

Resources

I used the following resources for this project: