FAUST (programming language): Difference between revisions

Content deleted Content added
Line 18:
 
==Overview==
The FAUST [[programming model]] combines a ''[[functional programming]] approach'' with a ''[[Block diagram|block-diagram]] syntax'':
* The functional programming approach provides a natural framework for [[signal processing]]. Digital signals are modeled as [[Sequence|discrete functions]] of time, signal processors as [[Higher-order function|second order functions]] that operate on them, and FAUST’s block-diagram ''composition operators'', used to combine signal processors together, as third order functions, etc. .
* Block-diagrams, even if purely textual like in FAUST, promote a modular approach of signal processing that suitscomplies very well thewith sound engineers’engineers' and audio developers’developers' habits, while providing a powerful and expressive syntax.
A FAUST program doesn’t describe a sound or a group of sounds, but a ''[[Digital signal processing|signal processor'', something that transforms input signals and produces output signals]]. The program source is organized as a set of ''definitions'' with at least the definition of the keyword <code>process</code> (the equivalent of <code>main</code> in C):
<source lang=cpphaskell>
process = ...;
</source>
 
The FAUST [[compiler]] translates FAUST programscode into equivalenta [[C++]] programs[[Object takingoriented careprogramming|object]], ofwhich generatingmay thethen most efficient code. The result can generally competeinterface with, andother sometimes even outperform, [[C++]] code writtento produce bya seasonedcomplete programmersprogram.
 
The generated code works at the sample level. It is therefore suited to implement low-level [[Digital signal processing|DSP]] functions like [[Infinite impulse response|recursive filters]]. Moreover theThe code canmay also be easily[[Embedded software|embedded]]. It is self-contained and does not depend on any DSP library or [[runtime system]]. It has a very deterministic behaviourbehavior and a constant memory footprint.
 
The semantic of FAUST is driven to be simple and well -defined. This is not just of academic interest. It allows the FAUST compiler to be ''semantically driven''. Instead of compiling a program literally, it compiles the mathematical function it denotes. This feature is useful for example tomay promote componentscomponent reuse while preserving optimal performance. Moreover, having access to the exact semantics of a FAUST program can simplify preservation issues.
 
FAUST is a textual language but nevertheless block-diagram oriented. It actually combines two approaches: [[functional programming]] and algebraic [[Block diagram|block-diagrams.]], Thewhich key idea is to view block-diagramare constructionconstructed asvia [[function composition]]. For that, FAUST relies on a ''block-diagram algebra'' of five composition operations.
 
==Example Code==