Skip to content

faluciano/golang-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MonkeyLang Interpreter

This project is part of the book "Writting and interpreter in Go". This repository keeps track of my progress through the book

Language Features

  • C-like syntax
  • Variable bindings
  • Integers and booleans
  • Arithmetic expressions
  • Built-in functions
  • First-class and higher-order functions
  • Closures
  • String data structure
  • Array data structure
  • Hash data structure

Language Syntax

Assignment:

let age = 10 * (20/2);
let myArray = [1, 2, 3, 4, 5];
let someHash = {"name": "Felix", "age": 100}

Accessing Elements:

myArray[0]
someHash["name"]

Functions:

let add = fn(a,b) { return a + b; };
let add = fn(a,b) { a + b; }

add(1,2);

Note: Monkey also supports higher order functions(functions as arguments)

Interpreter components

  • Lexer
  • Parser
  • Abstract Syntax Tree
  • Internal Object System
  • Evaluator

High level representation of interpreter steps

Interpreter steps

About

Interpreter written in golang for a made up language called monkey

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages