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

  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 new Pull Request