4 ms·
The problem with audio processing has always been latency. Are there functional programming languages out there which can guarantee bounds on latency?
by amelius 5y ago
The problem with audio processing has always been latency. Are there functional programming languages out there which can guarantee bounds on latency?
- tbenst 5y agoOCAML is used extensively for high-frequency trading, so indeed functional languages are used all the time in low latency settings. Galois has done work in Haskell for developing hard real-time applications. Here’s a dataflow language they built for example: https://leepike.github.io/pub_pages/rv2010.html https://leepike.github.io/pub_pages/rv2010.html
- spopejoy 5y agoIt looks like Copilot is an EDSL for making C99 programs. I would think both OCAML and Haskell (and Java for that matter), as GC'd runtime langs, would be unsuitable for realtime "out of the box". The best marriage of functional concepts and realtime I've seen is Supercollider (https://supercollider.github.io/ https://supercollider.github.io/) which basically has a smalltalk-like lang control a realtime backend. I'd love to see something like this for Haskell + Faust!
- tbenst 5y agoThanks for the comment, supercollider is really neat! Also just learned about Tidal Cycles, a Haskell library that builds on SuperCollider with a higher level functional syntax.
- whydid 5y agoThe problem with *digital audio processing is latency. Math operations on a DSP/CPU require cycle time. Cycle time can vary, but even a simple comparison can be 1-2 cycles, which could be nanoseconds of latency.
- matheist 5y agoIt's functional, not interpreted, if that's what you're getting at. It compiles down to deterministic C++. Each frame of audio takes exactly the same computation path; ditto for each sample within each frame. (Although some parameters might be updated once per frame, and others updated once per sample.) You could inspect the output C++ and count up the number of cycles for each frame of audio, if you wanted.
- amelius 5y agoHaskell is also a compiled language, but an often heard complaint is that it doesn't offer a good handle on CPU usage and hence computation time.
- jcelerier 5y ago> Are there functional programming languages out there which can guarantee bounds on latency? faust programs basically define a signal flow that gets compiled down to various languages, there won't be any latency besides the one that may be part of your own algorithm.
- deleted 5y ago[deleted]
- DC_Offset 5y agoXTLang / Extempore?