Skip to content

An experimental type-level Ruby interpreter for testing and understanding Ruby code

Notifications You must be signed in to change notification settings

hachi8833/ruby-type-profiler

 
 

Repository files navigation

Ruby Type Profiler

WARNING: Use Ruby 2.7.1 or master

Setup

git clone https://github.com/mame/ruby-type-profiler.git
cd ruby-type-profiler
git submodule init
git submodule update
cd rbs && bundle install && bundle exec rake parser && cd ..
bundle install
bundle exec ruby exe/type-profiler target.rb

Demo

# test.rb
def foo(x)
  if x > 10
    x.to_s
  else
    nil
  end
end

foo(42)
$ bundle exec ruby exe/type-profiler test.rb
# Classes
class Object
  def foo : (Integer) -> String?
end

Document

English / 日本語

Todo

Contribution is welcome!

  • Reorganize the test suite (by using minitest framework or something)
  • Design and implement an reasonable CLI UI (nothing is configurable currently)
  • Release a gem
  • Continue to perform an experiment

About

An experimental type-level Ruby interpreter for testing and understanding Ruby code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%