Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreyrcdias/monkey
Monkey language interpreter from the book "Writing an Interpreter in Go"
https://github.com/andreyrcdias/monkey
interpreter
Last synced: about 2 months ago
JSON representation
Monkey language interpreter from the book "Writing an Interpreter in Go"
- Host: GitHub
- URL: https://github.com/andreyrcdias/monkey
- Owner: andreyrcdias
- Created: 2024-08-03T15:53:24.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-30T21:49:30.000Z (4 months ago)
- Last Synced: 2024-09-18T10:11:53.885Z (4 months ago)
- Topics: interpreter
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# monkey
Self-study of the book "Writing an Interpreter in Go" by Thorsten Ball
> Work in Progress
## The Monkey Programming Language & Interpreter
Expressed as a list of features, Monkey has the following:
- C-like syntax
- variable bindings
- integers and booleans
- arithmetic expressions
- built-in functions
- first-class and higher-order functions
- closures
- a string data structure
- an array data structure
- a hash data structure```c
let age = 28;
let name = "Andrey";
let result = 10 * (20/2);// array and hashes support
let myArray = [1, 2, 3, 4, 5];
let tidras = {
"name": "Andrey",
"age": 28,
};// acessing the elements and hashes is done with index expressions:
myArray[0] // => 1
tidras["name"] // => "Andrey"// the `let` statements can be used to bind functions to names.
let add = fn (a, b) {
return a + b;
};
```## REPL
```
go run main.go
```