Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luka2220/fun-interpreter
Interpreter for a new programming language with basic features
https://github.com/luka2220/fun-interpreter
evaluation interpreter java lexical-analysis parsing
Last synced: 4 days ago
JSON representation
Interpreter for a new programming language with basic features
- Host: GitHub
- URL: https://github.com/luka2220/fun-interpreter
- Owner: luka2220
- Created: 2024-05-29T02:11:44.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-14T14:02:19.000Z (7 months ago)
- Last Synced: 2024-06-14T15:27:40.246Z (7 months ago)
- Topics: evaluation, interpreter, java, lexical-analysis, parsing
- Language: Java
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fun Interpreter
This interpreter was derived from the book *Writing an Interpreter in Go* which I followed to get the basic structure for lexical analysis & tokenization, parsing, and evaluation.---
## Language Features
The language that I built the interpreter on is a made-up one. However, it has the features of most modern programming languages today with C-like syntax:
- variable bindings
- integers & booleans
- arithmetic expressions
- built-in functions
- first-class & higher-order functions
- closures
- string data structure
- array data structure
- hash data structure---
## Sample Code
```
let fibonacci = fn(x) {
if (x == 0) {
return 0;
} else {
if (x == 1) {
return 1;
} else {
fibonacci(x - 1) + fibonacci(x - 2);
}
}
};
```