GSoC/GCI Archive
Google Code-in 2011 Parrot Foundation

Remove "new string" opcodes

completed by: Aleksandar

mentors: Andrew Whitworth

Task Description

Parrot uses immutable strings internally. This means that string buffers, once created, cannot be modified. This is an important tool to prevent string data contention when in a multi-threaded environment, and is also a powerful tool for compilers and optimizers to use to optimize and better manage resources.

Parrot provides some old, legacy opcodes which do not make sense if Parrot's string types are immutable. The "new" opcode, which returns a new, empty string is one such opcode. In fact, there are two "new" opcodes, both of which don't make sense. Your task is to delete the "new" opcodes from src/ops/string.ops and update any code which might accidentally be relying on them.

Steps To Complete This Task

  1. Create a fork of parrot.git on github.com
  2. Build Parrot (This is IMPORTANT)
  3. Remove the "new" opcodes from src/ops/string.ops
  4. Run "make bootstrap-ops" to rebuild the ops files for Parrot. Notice that the rebuild requires an existing build of Parrot to perform. This step may take several minutes.
  5. Build Parrot and run its test suite ("make test") to verify that things still work
  6. Fix any broken tests or other broken code which might still be relying on the old opcodes (test again to verify, if changes are made)
  7. Create a Github pull request (button on the upper right of your fork) to have your changes incorporated into the master repository

Benefits

  1. The "new string" opcodes are deprecated and need to be removed. They do not make any sense in the context of Parrot's current string implementation and are confusing. Getting rid of them helps to decrease confusion and decreases maintenance burden.

Requirements

  1. C programming Language

Additional Links