Welcome to my portfolio; here I will walk you through some of the lab work that you see referenced on the sidebar, as well as give a brief overview of some things I have done that are not on this web page. While all of the labs have some interesting content, the ones that I will reference here are especially well put together or interesting.
Multi Method Dispatch, MMD, is a system of dispatching a function or method dynamically based on the runtime type of all of the arguments to the function. A polymorphic function call (as provided by just about every object oriented language in existence) can be seen as a 1 dimensional case of this more general concept. I am afraid that I am digging myself a hole here rather than clarifying things, so I think an example is called for.
Why don't we start with the standard example used for everything in the world of object orientation, shapes. I won't belabor why we want to have an inheritance hierarchy with Shape
as the base class, but we do. Since every shape has its own unique way to draw it or calculate its area, the correct method must be dynamically called on any Shape*
at runtime (this is usually accomplished with an array of function pointers). In this light a polymorphic function call is simply a function that selects the correct method to call based on the type of its argument. Now consider the case where I have a function that calculates the intersection of two shapes. It is not enough to know the runtime type of one of the two Shape
s, as a Circle
and a Square
would calculate their intersection differently than two Square
s or two Circle
s would. Thus one must know the true type of both objects and execute a specialized method based on these types. Multi Method Dispatch is exactly that, a system for calling the correct function based on the types of all arguments.
My page describes the implementation details of and trade offs made in a type-safe library to provide multi method dispatch for arbitrary classes that I wrote for a programming languages course. The current implementation only performs double dispatch, although the generalization to higher dimensions is straight forward and commented in the code. Templates are used heavily throughout the code to provide the desired type-safety. You can see in the class structure the design decisions that went into this project. While the base class implements the behavior correctly, it places a greater burden on the user. After this class was successfully implemented and debugged, a child class was added to simplify the interface and perform some of the bookkeeping.
In my artificial intelligence class we were assigned to create a game playing agent for a simple game called Konane. The purpose of the assignment was to have us implement a standard minimax algorithm with alpha-beta pruning. A static evaluator (to be run after minimax had descended to a preset depth) would then be used to evaluate the board state. Initially, my roommate (who was also in the class) and I both felt that this assignment did not provide any interesting nuance and thus we should work together simply to get it done more quickly. As we began to talk about the static evaluator, we ran into a difficulty communicating our ideas and needed to nail down a more precise language to communicate our thoughts about the problem. As our language evolved so too did the abstraction of our implementation and the technique we used to solve the problem. This lab provides a more in depth explanation of these thoughts and techniques, as well as how we arrived at them. This lab provides a clear example of how my strong mathematical background assists abstract thought about a problem as well as my ability to communicate those thoughts with others and develop a dialog which furthers thought.
In computer graphics, I created a z-buffered 3D graphics engine that supported alpha blending. As you can imagine this project was developed over many weeks and individual parts were assigned as labs, where each one built upon the last. This assignment for this lab was to incorporate perspective transformations into the engine. Like every project that has new features added to it, my graphics engine has developed a fair amount of cruft by the time of this assignment. Frankly, my engine had developed more cruft then I would have liked because the previous assignment had been done under heavy time constraint. Thus for this assignment I started early and refactored heavily. This can be seen in the simplified interface and better usage of objects to provide abstraction than in previous labs. The code clean up can also be seen in the elimination of excess classes that only served to muddy the interface by strapping new features onto and around older ones.
Kernel Hacking
For my operating systems class, we extended the linux kernel for several projects. My group and I implemented new synchronization primitives, replaced the scheduler, and added new kernel modules to the linux 2.4 kernel. While these projects focused on adding new features to the kernel, a large part of the work in each assignment was researching the systems already in place and finding the correct way to add features with minimal intrusions. Another important focus of these projects was using the tools and paradigms already extant in the kernel and using these mechanisms to our advantage. Much of my interest in kernels and system programming stems directly from this class and its assignments.
C Compiler
Sophomore year I took a course on compilers. The three main projects for the course, each of which built off the last, were a lexer, parser, and code generator. All of the assignment were written in pure C, without the aid of anything but STDIO. While we only implemented a subset of C for this compiler, it did support recursion and pass by reference semantics for arrays. In retrospect, the were many places where the code could be simplified or cleaned, but at the end of this project I had a large program that served as a powerful tool for abstraction written entirely by me. This project sparked my interest in programming languages and compilers, while simultaneously showing me how powerful and simplifying the theory behind an algorithm could be. My interest in programming language and compilers is certainly a direct result of this class.
Last modified 2004-02-20 15:00 EST