You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a project to write an interpreter and a compiler for a made up language Monkey, following the book "Writing an Interpreter in Go", and its sequel "Writing a Compiler in Go".
1
+
This is a project to write an interpreter and a compiler for a made up language Monkey. The repository follows the book "Writing an Interpreter in Go" until Tag `Book1End`, and its sequel "Writing a Compiler in Go" until Tag `Book2End`. All further commits are my own contribution.
2
2
3
-
https://interpreterbook.com/
4
-
https://compilerbook.com/
3
+
-https://interpreterbook.com/
4
+
-https://compilerbook.com/
5
+
6
+
# How to run
7
+
8
+
### Linux
9
+
10
+
1. Clone the repository
11
+
2. Run the command `cd MyCode/` to change directories.
12
+
3. To run the REPL, run the command `./build/monkey`.
13
+
4. Alternatively, create a file with extension `.mky` and run the command `./build/monkey [file]` to compile and run the file
14
+
15
+
A pre-written file `test.mky` is also present in the repository
16
+
17
+
# Running benchmarks
18
+
19
+
### Linux
20
+
1. Clone the repository
21
+
2. Run the command `cd MyCode/` to change directories.
22
+
3. To run using compiler and vm, run the command `./build/fibonacci -engine=vm`
23
+
4. To run using interpreter, run the command `./build/fibonacci -engine=eval`
24
+
25
+
- Currently the benchmark is based on a pre-written fibonacci recursion program.
26
+
- The fibonacci number can be changed by going into `./benchmark/main.go Ln 30`, and editing the number in the function call.
0 commit comments