Skip to content

Python implementation of the Monkey programming language. πŸ’

License

Notifications You must be signed in to change notification settings

nischalshrestha/PyMonkey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PyMonkey

Description

Python version of the Monkey programming language:

alt text

NOTE: This is a personal project created for the sole purpose of learning how to build interpreters / compilers and honing my Python skills. You may borrow code under the licence.

Dependencies

  • Python 3.6+

Execution

Inside the src/monkey:

The Monkey interpreter plus macros can be run with:

python main.py

The compiler isn't complete yet but can be run with a flag --c:

python main.py --c

Ultimately, to compile a Monkey file, this command will be used instead:

python main.py [Program.mnk] [args]

Testing

Inside the test:

python [test_file].py

Progress

Interpreter

  • Interpreter
  • Built-in types and functions

Extras

  • Macros

Compiler

  • Compile expressions
  • Conditionals
  • Data structures
  • Functions
  • Closures

Possible Future extensions

  • Better error handling (stack trace)
  • More operators like postfix (e.g. ++, --) or ternary
  • Default arguments to functions
  • Macros hygiene
  • Debugging Macros
  • Continuations
  • Time travel debugging

About

Python implementation of the Monkey programming language. πŸ’

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages