tsPyC

Overview

TsPyC was my honours project for my Software Engineering degree at the University of Queensland. I have done very little further work on it since completing my honours thesis in 2009.

Description

TsPyC (rhymes with “spicy”) is a new programming language. This raises the obvious question, “Why do we need another programming language?” TsPyC is different because it is built with extension in mind. It gives programmers the flexibility to enhance the compile-time behaviour of the language.

There numerous situations in which this flexibility could come in handy. For instance, tsPyC gives the programmer the ability to introduce new keywords into the language and define their behaviour. By introducing such keywords, programmers have the ability to write code that reflects more clearly what they want to happen rather than the fine detail of how it should be done. It also allows programmers to develop domain-specific extensions to the language.

TsPyC’s extensibility also gives programmers the ability to additional layers of static checking to be done during the process of compiling a program, allowing a greater degree of certainty that a program is robust. Furthermore, the implementation of tsPyC includes a mechanism for generating C code from a syntax tree structure. This mechanism is modular, so may be used to generate and compile C code in applications that do not rely on the rest of tsPyC, thus simplifying the task of writing programs which generate C code.

Primarily, tsPyC can:

  • compile tsPyC source code to machine code
  • allow users to customise the compilation process using Python files
  • be platform- and system-independent to the greatest degree possible.

TsPyC also:

  • provides a Python framework for generating machine code from Abstract Syntax Trees
  • makes use of the GNU Compiler Collection (GCC) for machine code generation

Status

As of April 2010, tsPyC is in a state roughly approximating completion. That is, it works, but there are still things that should be improved about it. I have not done any work on it since completing my thesis project in November 2009. The tsPyC code repository is available on launchpad.

Motivation

The motivation of this project came from these premises:

  • Programmers should be able to generate machine code more easily.
  • Compiler preprocessors need not be as restrictive as they are.

The project aims to bring flexibility to compiled programming languages.

Documents

Comments are closed.