monkey-lang-swift
monkey-lang-swift copied to clipboard
The Monkey Programming Language written in Swift -- Writing An Interpreter In Go
🐒 The Monkey Programming Language
This repository is the monkey lang interpreter written in Swift.
Monkey is a programming language designed for Writing An Interpreter In Go
Overview
let version = 1;
let name = "Monkey programming language";
let myArray = [1, 2, 3, 4, 5];
let coolBooleanLiteral = true;
let awesomeValue = (10 / 2) * 5 + 30;
let arrayWithValues = [1 + 1, 2 * 2, 3];
let fibonacci = fn(x) {
if (x == 0) {
0
} else {
if (x == 1) {
return 1;
} else {
fibonacci(x - 1) + fibonacci(x - 2);
}
}
};
Getting Started
Simply run the monkey to play with REPL.
$ git clone https://github.com/prologic/monkey-lang
$ monkey-lang
$ make
$ .build/release/monkey
Usage
- REPL
$ monkey
$ monkey repl
- Run Source Files
$ monkey path/to/file.monkey
Requirements for build
- Xcode 10.2.1+
- Swift 5.0.1+
Lisense
MIT