GSoC/GCI Archive
Google Code-in 2011 Parrot Foundation

Refactor and rename Parrot_pf_load_language

completed by: Aleksandar

mentors: Andrew Whitworth

Task Description

The function Parrot_load_language in src/packfile/api.c is too large and complicated. It will be easier to understand and maintain if it can be broken into smaller functions with descriptive names and limited variable scopes. Refactor this function. Break the logic into smaller static functions where possible. Clean up the code. Add comments to describe parts of the logic whose purpose is not obvious. Also, rename the function from Parrot_load_language to Parrot_pf_load_language (the _pf_ tells what subsystem the function is in). Make sure to update all references to the function throughout the codebase.

Steps To Complete This Task

  1. Create a fork of parrot.git on github.com
  2. Perform all the necessary code and/or documentation changes
  3. run "make headerizer" to update header files with the new function name
  4. Build parrot and run it's test suite (make fulltest) to verify that things still work
  5. You can also submit a smoke report with "make smoke", but that is optional. This requires installing a few Perl modules from CPAN.
  6. Create a Github pull request (button on the upper right of your fork) to have your changes incorporated into the master repository

Benefits

  1. Cleaner, properly factored code is easier to read and understand. It is also easier to maintain over long periods of time if people understand what it does and individual bits of logic are broken into atomic operations.

Requirements

  1. C Programming

Additional Links