phelt
Version, currently master branch1 version
- master branchlatestAug 22, 2020
github.com/benphelps/phelt-cr
phelt is a toy programming language
3 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
phelt:
github: benphelps/phelt-cr
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.35.1- License
- MIT
- Author
- Ben Phelps
- Target
pheltfrom src/phelt.cr
Dependencies
Runtime Dependencies
- debug*github: Sija/debug.cr
README
phelt
phelt is a toy programming language.
Features
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.entryorhash["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 environment.ph for functionality built unsing phelt it's self.
- When calling a function on an object (eg.
Installation
Once you have Crystal setup locally, simply run:
shards build phelt
The phelt interpreter can be found in the bin/ directory.
Usage
Usage: phelt [command] [program file]
-v, --version Show version
-h, --help Show help
-d, --debugger Interactive Debugger
-i, --interactive Interactive REPL
Contributing
- Fork it (https://github.com/benphelps/phelt/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Ben Phelps - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Aug 22, 2020
- Crystal
0.35.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/benphelps/phelt-cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1