UbyInterpreter
Ruby-like interpreter implementation.
Based on a talk by Ryan Davis.
Features
- Basic numeric types, true, false, strings, arrays, hashes and nil
- Conditional branching and looping
- Primitive and user defined functions
- Local variables and variable scoping
- Test-driven, extensible, patterns-based design
- ~130 LOC for implementation, ~70 LOC for tests
- Fits in one head
Installation
Add this line to your application's Gemfile:
gem 'uby_interpreter'
And then execute:
$ bundle
Or install it yourself as:
$ gem install uby_interpreter
Usage
Comes with executable.
Run a file with
$ uby /path/to/your/file
Or simply run
$ ./bin/uby example.rb
to see what this little fellow can do!
Running tests
$ rake
Contributing
- Fork it
- 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 new Pull Request