ra1028 / monkey-lang-swift

The Monkey Programming Language written in Swift -- Writing An Interpreter In Go

Home Page:https://interpreterbook.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐒 The Monkey Programming Language

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

Official Website

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

About

The Monkey Programming Language written in Swift -- Writing An Interpreter In Go

https://interpreterbook.com

License:MIT License


Languages

Language:Swift 99.7%Language:Makefile 0.2%Language:Monkey 0.2%