GSoC/GCI Archive
Google Code-in 2011 Parrot Foundation

Cleanup src/interp/

completed by: Bilal Akhtar

mentors: Andrew Whitworth

Task Description

Parrot is broken into several subsystems. Each subsystem has an API that is used by the rest of the VM. Functions are typically named Parrot__(). For instance, all the functions in src/pmc.c are named Parrot_pmc_*. All the functions in src/gc/api.c are named Parrot_gc_*. The functions in src/interp/inter_misc.c and src/interp/inter_create.c do not follow this convention, or other conventions. You are going to fix this.

Create a new file src/interp/api.c. Merge all the contents of the files src/interp/inter_create.c and src/interp/inter_misc.c into src/interp/api.c. Delete the other two files. Delete their entries in the file MANIFEST, and add your new file. Update the makefile template config/gen/makefiles/root.in to build your new file, and not build the old files. Rename all functions in these files to use the proper prefix "Parrot_interp_". Use your best judgement to rename functions. For instance, interpinfo_s() should probably be renamed to Parrot_interp_info_string() instead of Parrot_interp_interpinfo_s(). Again, use your best judgement. Update all references to these functions throughout the codebase and test suite.

Steps To Complete This Task

  1. Create a fork of parrot.git on github.com
  2. Create file src/interp/api.c. Merge src/interp/inter_create and src/interp/inter_misc.c into it. Delete the old files.
  3. Add the new src/interp/api.c to the makefile template config/gen/makefiles/root.in. Update MANIFEST to account for additions and removals.
  4. Rename all functions to Parrot_interp_*. Try to be descriptive. Ask for help if you don't know what a function does, or what might be a good name for it.
  5. Build Parrot and run all tests.
  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. Following consistent coding standards is important because it makes code more readable and maintainable.

Requirements

  1. C Programming Language
  2. Makefiles and make

Additional Links