or: Static Analysis of nil Values in Ruby Code used in YaST.

YaST is written in Ruby. A large part of the code is Ruby that was transpiled from the YCP language during the YCP Killer project. To preserve behavior in various edge-case situations, mostly when nil was passed around, helper libraries were used. The resulting code is often long and hard to work with.

Example from SlideShow.rb:

total_time = Ops.add( total_time, Ops.divide(Ops.get_integer(stage, "value", 0), 3495) )

The plan is to find patterns in Y2R-generated code which can be safely translated into more native Ruby code and translate them. In many cases this will require proving that the edge cases mentioned above can't happen (e.g. that passed parameters can't be nil). This will be done using static analysis on the code.

We have started this during HackWeek 11 with the Zombie Killer project, but did not finish back then.

Since that time, we started using RuboCop in the team to keep a consistent code style. It is a natural match to bring RuboCop and Zombie Killer together, since both are based on the Parser library. RuboCop-YaST was started by Ladislav Slezak, but Zombie Killer is not fully integrated and working.

During HackWeek 13 the goal is to have a safely working RuboCop-YaST that is able to resocialize some zombies in production code.

Looking for hackers with the skills:

ruby compiler

This project is part of:

Hack Week 13

Activity

  • almost 10 years ago: IGonzalezSosa liked this project.
  • almost 10 years ago: mvidner added keyword "ruby" to this project.
  • almost 10 years ago: mvidner added keyword "compiler" to this project.
  • almost 10 years ago: mvidner started this project.
  • almost 10 years ago: mvidner originated this project.

  • Comments

    • mvidner
      almost 10 years ago by mvidner | Reply

      Version 0.8 released:

    Similar Projects

    Recipes catalog and calculator in Rails 8 by gfilippetti

    My wife needs a website to catalog and sell the products of her upcoming bakery, and I need to learn and practice modern Rails. So I'm using this Hack Week to build a modern store using the latest Ruby on Rails best practices, ideally up to the deployment.

    TO DO

    • Index page
    • Product page
    • Admin area -- Supplies calculator based on orders -- Orders notification
    • Authentication
    • Payment
    • Deployment

    Day 1

    As my Rails knowledge was pretty outdated and I had 0 experience with Turbo (wich I want to use in the app), I started following a turbo-rails course. I completed 5 of 11 chapters.

    Day 2

    Continued the course until chapter 8 and added live updates & an empty state to the app. I should finish the course on day 3 and start my own project with the knowledge from it.

    Hackweek 24

    For this Hackweek I'll continue this project, focusing on a Catalog/Calculator for my wife's recipes so she can use for her Café.

    Day 1


    GHC-9.14 and split Hadrian from GHC build by osukup

    Description

    Prepare openSUSE Tumbleweed project for new GHC Haskell compiler and separate builder (Hadrian) from GHC build

    Goals

    • have GHC-9.14 project with working compiler and if possible filled with packageset
    • have Hadrian in own package built with bootstrap compiler to separate Hadrian bootstrap from ghc bootstrap

    Resources

    devel:languages:haskell

    d:l:h:ghc-9.12.x

    opensuse Haskell rpm macros

    opensuse haskell package gen project