Technical Communication for Computer Scientists: 15-221 Spring 2015

Progress Report: C0 Debugger

Aaron Gutierrez Mitchell Plamann Shyam Raghavan Suhaas Reddy

Submitted to Thomas M. Keating Assistant Teaching Professor Computer Science Department School of Computer Science

Prepared and Submitted by Shyam Raghavan - April 14, 2015

Contents

i

1 Overview

1.1 Purpose of the Report

This report serves as an update to the reader on the progress the c0db team has made on the C0 Debugger during the first month of work. The report will detail what has been accomplished so far, what is in progress, what is planned for the future, and any changes that will be made to the original plan of action. In addition, the report will detail new literature that has been gathered and used.

1.2 Purpose of the Project

The purpose of this project is to build a web application that can debug C0 code and can aid in a student’s understanding of fundamental computational models. This project will benefit students in 15-122 Principals of Imperative Computation at Carnegie Mellon University by helping them create correct programs. The C0 Debugger will enable students to understand how their programs execute and find where problems originate more easily than with existing tools. In addition to debugging, students will have better knowledge for how the underlying computation model works when evaluating their code.

The C0 Debugger will also enable students to test simple programs with little setup, using only a web browser. They will no longer have to set up and become familiar with a Unix environment before they can program, making C0 accessible to more people, more quickly.

2 Literature Review

Since the start of our project, we have found multiple new information sources; the following are the most important ones.

• Nodeunit documentation https://github.com/caolan/nodeunit

We are using nodeunit to test our virtual machine. Since the c0 bytecode has many different opcodes that it uses, it is very easy for mistakes in the virtual machine to go unnoticed. To prevent this, we are using the nodeunit library to write unit tests for our code. This has already helped us to find and solve multiple bugs in the VM, and having these unit tests will make sure that we can solve any bugs that occur as the result of future changes in the code.

• c0vm Assignment Handout https://www.cs.cmu.edu/ rjsimmon/15122-f14/prog/c0vm-writeup.pdf

This document details how each opcode in the c0 bytecode language works, as well as other important implementation details for the c0 virtual machine. It has been an important reference while developing a JavaScript version of the c0 virtual machine.

• Common Gateway Interface Support Documentation https://docs.python.org/2/library/cgi.html

This document explains the support module defined by Python 2.7.10 for common gateway interfaces. A common gateway interface script is usually invoked by a server to process user input submitted through an HTML element. This piece of documentation is an important reference for developing the flow of information from c0 code to c0 bytecode to a working virtual machine.

So far, the most important thing we have learned is that good unit tests are vital for developing this sort of project. Without unit tests that verify each opcode used by the virtual machine, many bugs would have gone