LLVM backend for Faust


FAUST is a compiled language for real-time audio signal processing. The name FAUST stands for Functional AUdio STream. Its programming model combines two approaches : functional programming and block diagram composition. You can think of FAUST as a structured block diagram language with a textual syntax.

LLVM (Low Level Virtual Machine) and is a very interesting open-source project that provides a set of tools to develop compilers and related technologies. It provides a SSA based Internal Representation format, ObjectiveC/C/C++ front end, JIT, and various backends.

We plan to develop a new backend for Faust that will directly produce LLVM IR instead of the C++ class Faust currently produces. With a (yet to come) library version of the Faust compiler, it will allow developers to embed Faust + LLVM JIT to dynamically define, compile on the fly and execute Faust plug-ins. LLVM IR and tools also allows some nice bytecode manipulations like "partial evaluation/specialization" (also called "runtime optimization" by LLVM guys...) that we also currently investigate.

The source code of the llvm branch can be downloaded from the SourceForge site:

cvs -d:pserver:anonymous@faudiostream.cvs.sourceforge.net:/cvsroot/faudiostream login (with no CVS password)

cvs -z3 -d:pserver:anonymous@faudiostream.cvs.sourceforge.net:/cvsroot/faudiostream co -P faust

cd faust

cvs up -dP -r llvm

make && sudo make install

A version of the jack/gtk plug-in that will load a Faust LLVM bytecode file can be compiled in the LLVM folder:

make -C LLVM tools

Faust LLVM bytecode can be produced from a .dsp source file, using a new "-llvm" parameter:

cd examples && faust -llvm freeverb.dsp -o freeverb.bc

and launched with llvm-jack-gtk:

llvm-jack-gtk freeverb.bc

The Faust LLVM bytecode file is not functionnal yet, the GUI is (almost) correctly compiled, but not the DSP code. News will be regurlarly added on this page.