Sorbet is a gradual type checker for Ruby.

Ruby is a dynamic language, which is great for reducing overhead for small projects and rapid prototyping. YaST has half a million lines of code and is almost 20 years old. (If this match does not seem insane, you must be remembering the YCP language, of which YaST was the sole user in the world.)

We routinely get bug reports of "Internal Error" which are caused by a typo in a class name, method name, or most frequently a nil creeping in where a real value is expected. We spend time writing tests not for behavior but for catching this kind of trivial bugs. Type checking should help this.

Results

We type check a big part of yast2-ruby-bindings.rpm (the bottom Ruby layer) and a small part of yast2.rpm (a diverse library on top of it).

In a sorbet-typedbug-demo branch I have added a bug to show how a detected bug looks like.

This is not in openSUSE Factory yet because I want to make yast2-ruby-bindings fully covered first. Otherwise increasing its coverage later would break downstream code with false positives.

Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 18 Hack Week 20

Activity

  • over 2 years ago: ancorgs liked this project.
  • over 2 years ago: a_faerber liked this project.
  • over 2 years ago: mvidner started this project.
  • over 2 years ago: mvidner originated this project.

  • Comments

    • mvidner
      over 2 years ago by mvidner | Reply

      I think I will make this a social project as much as a technical one: talking with people in my team and finding how to make the type checker help them, showing them what it can do.

    Similar Projects

    This project is one of its kind!