Programming in Mathematical Notation

Scientific and numerical algorithms are neatly typeset in textbooks and papers, with compact mathematical notation. The scientific programmer converts that notation into computer code, which tends to be much longer and harder to follow (and harder to verify the correctness). There are many regularities in this conversion process that we would like to relegate to the computer.

MathML is a standard for display and interchange of mathematics. It has two parts - presentation and content. The presentation part covers the display and rendering of math (as expected from the name). The content part is concerned with conveying the meaning in a structured form.

A Domain Specific Language (DSL) is a special purpose computer language that matches a problem domain closely. This can make reading, writing, and reasoning about the correctness of the code much easier.

The goal of this project is to use content MathML as a starting point for a DSL for scientific programming. (Even "scientific programming" is too large of a domain, so I will restrict the domain to certain quantum and statistical physics problems for now.)

So far, I have a prototype that inputs an XML file and outputs three forms: text, xhtml, and C++. The input file is content MathML with a few additions. The text output is a vaguely TeX-like text representation. The xhtml output is an xhtml file in presentation MathML format. This is the format that displays neatly in the browser. The third output is a C++ file.

Contents

Next page: A simple function

Written by Mark Dewing on July 20, 2005. Last update on September 21, 2005.