Skip to main content

Chestnut Programming Language


Chestnut Programming Language

Andrew Stromme and Tia Newhall

Hi there! I'm Andrew Stromme and this summer I'm working on Chestnut, a fledgling programming language. Chestnut uses the powerful graphics cards that are found in most computers to perform simulations and visualizations. It is built on top of NVidia's excellent CUDA technology. CUDA enables developers to write programs that run in parallel on their graphics cards, however its complexity and options for tweaking performance can be daunting for newcomers, and especially for those who are less familiar with the internals of graphics cards.

Chestnut solves this by presenting a simple model for parallel computation. In the simple case, all input and output data is of the same size and shape and the programmer only has to come up with how to combine individual pieces of inputs into a single output. For example, for each piece of data, vector addition is just c = a + b where A, B, and C are all vectors and a, b, c are individual units of data. Chestnut then performs this operation across the entire data set in parallel. This form of computation is well suited for things like vector or matrix addition in which the two input matrices have the same shape as the output. In the more complex case the programmer has to specify how to create a piece of output data given full access to all of the inputs. This allows for more complex problems such as matrix multiplication where the two input matrices can be of different shapes. A developer can ease into Chestnut by starting with the simple model and later building up to the more complicated model.

Visualizations are natively supported and are designed to be fast. Programmers use the normal Chestnut model to specify how to create each pixel in a display window using their native data set, while Chestnut internally uses CUDA and OpenGL to do the rest. During display, all of the data stays on the graphics card which allows for better performance.

Also included is Chestnut Designer, a graphical environment which aims to provide an even simpler introduction to the language and its concepts. Employing a drag and drop interface with color coding and shape coding for inputs and outputs, the designer is a good way to model problems visually.