Skip to content

hxt365/Monkey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monkey programming language

Introduction

Created a new programming language called Monkey. Monkey was implemented twice using two different approaches:

  • 1st - interpreter approach: Pratt parsing -> Tree-walking interpreting
  • 2nd - compiler + VM: Pratt parsing -> Compiling to bytecode -> VM

Did a benchmark which showed that the compiler approach offers three times faster execution time than that of the other approach.

hxt365@Truongs-Air monkey % go run benchmark/main.go -engine="vm"
>> engine=vm, result=9227465, duration=4.354578s
hxt365@Truongs-Air monkey % go run benchmark/main.go -engine="eval"
>> engine=eval, result=9227465, duration=15.337929584s

Resources

  • Writing An Interpreter In Go book by Thorsten Ball
  • Writing A Compiler In Go book by Thorsten Ball

About

A new programming language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages