phelt is a toy programming language


Build Status

phelt is a toy programming language.


phelt is based on Monkey, as implemented in the Interpreter Book, with the following additions:

  • Run code from files, not just a REPL.
  • Improved error reporting, including line and column information.
  • 64 bit Floats & Integers.
  • Infix assignment operators =, +=, -=, *= /=.
  • Additional comparsion operators, <=, >=.
  • do { } blocks for scoped expressions.
  • For loops, for(initial; condition; final) { break; } & while loops, while(condition) { break; }.
  • eval() for executing code from string input.
  • Arrays are mutable, with an extended array toolset.
  • Truly constant constants, once defined they can never be redefined, regardless of scope.
  • Fully reworked hashes. Hash keys are limited to identifiers and integers. You can access as well as index hash entries, hash.entry or hash["entry"] both work.
    • This allows for some level of pseudo-class functionality.
    • This may be expanded upon in the future by implementing meta-functions on hashes.
  • Pseudo object functionality built using hashes.
    • When calling a function on an object (eg. [1, 2, 3].first), the functions object type is mapped to an internal hash. The hash stores functions callable on that object type.
    • See for functionality built unsing phelt it's self.


Once you have Crystal setup locally, simply run:

shards build phelt

The phelt interpreter can be found in the bin/ directory.


Usage: phelt [command] [program file]
    -v, --version                    Show version
    -h, --help                       Show help
    -d, --debugger                   Interactive Debugger
    -i, --interactive                Interactive REPL


  1. Fork it (
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


github statistic
  • 2
  • 0
  • 0
  • 1
  • 11 months ago
  • August 1, 2020

MIT License

Synced at

Fri, 23 Jul 2021 17:07:57 GMT