Could we finally ditch C++ for VSTs?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

DJ Warmonger wrote: Fri Oct 11, 2019 6:44 pm C++11 has many features that help creating idiot-proof, safe and automagical libraries which handle all the typing, safety checks and boilerplate code.
However, all this comes naturally in more moderns languages and is transparent to their user. It's not the case in C++11, however, since it still maintains backward compatibility with original language that is 47 years old.
It does, but I just ignore it all. I'm the only one working on the code and I've got far better things to do. Same thing with Java--1.6 seems the best balance between elegance and utility. I'd use just plain C++, except I'm lazy and want the simpler file handling--while it's not perfect, it's still easier than C.

Programming paradigms change very quickly and languages try to adapt, but just get bogged down. The main problem with C++ is the same with any language that's become entrenched in the business world. There's huge code bases that businesses don't want to give up, nor pay to have translated to a more modern language. I'm sure there's still some COBOL out there, somewhere, lurking... :scared:
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

syntonica wrote: Fri Oct 11, 2019 7:34 pm I'm sure there's still some COBOL out there, somewhere, lurking... :scared:
You have no idea ... there are oceans of it.

Post

dmbaer wrote: Sat Oct 12, 2019 8:06 pm
syntonica wrote: Fri Oct 11, 2019 7:34 pm I'm sure there's still some COBOL out there, somewhere, lurking... :scared:
You have no idea ... there are oceans of it.
I was once interviewed for such position. They told COBOL is used in mainframe systems, for instance in banking - and these need to keep running non-stop.
Blog ------------- YouTube channel
Tricky-Loops wrote: (...)someone like Armin van Buuren who claims to make a track in half an hour and all his songs sound somewhat boring(...)

Post

ReaJS is really fast and I have no idea how Reaper did it but it runs as a VST plugin. Why can't every development platform work like that? Isn't there a compiler setup for it too? Pretty sure you can just convert a ReaJS script into a VST now.

Post

overhishead wrote: Sat Oct 19, 2019 9:50 am ReaJS is really fast and I have no idea how Reaper did it but it runs as a VST plugin. Why can't every development platform work like that? Isn't there a compiler setup for it too? Pretty sure you can just convert a ReaJS script into a VST now.
ReaJS doesn't have garbage collection and it doesn't have dynamic typing. So you can compile it into fast machine code using a just-in-time compiler like SLJIT. 8)

Post

This is a super interesting thread.
Do any of you have fresh insights about C++ alternatives for audio development?
Has anyone tried Rust or Kotlin Native recently?

Post

With CLAP, which has a C interface, you can do Rust, Zig, Delphi or whatever you want. There are wrappers around.

For some of the languages named the hardest part will be to find a suitable multiplatform UI library.

Post

Octasine (star of KVR OSC #170) is written in Rust and targets VST2 and CLAP. The UI is built in the Iced toolkit. Other plugins use NIH-plug to target VST3 (and CLAP) and I think some use egui for their UIs. At any rate, there are multiple options.

The argument over cyclic references was never really settled, but I can tell you now that intrusive cyclic references will never be considered "safe" in Rust unless they're protected by some kind of synchronization primitive. If this were allowed, it would break Send and Sync, and then Rust's entire thread safety model would collapse like a house of cards. So, you can either write unsafe code while manually tracking your own invariants, or you can eat the performance cost and use safe alternatives. If you're using C++, you're already taking the first option anyway.
I hate signatures too.

Post

Does some framework allow one to not think about memory management etc. while giving the performance? I think those things are not really about sound algorithms but about the computer.

The time spent on those things would easily be better used in just the sound algorithm part. Or, in other words, things like Faust of Pd are in fact quite useful abstractions.

In fact, any library, e.g. a filter library, does give those abstractions, but maybe the problem is that there's a lack of such libraries.

But I don't think it's useful to think about array allocation compared to "Now I want FFT with this quality with this block size with this window". I think there's more value to be gained in signal chains than in low-level implementations. This can be exemplified e.g. by that one gets a new compressor by combining two or more existing ones. But this can be done without programming anything new.

Or think again about how one works in Matlab or, say, R. It has much better usability than C++.

Post

Different tools for different purposes with different drawbacks I guess.

Post

rafa1981 wrote: Wed Jun 14, 2023 11:32 am Different tools for different purposes with different drawbacks I guess.
This is obvious. What's not obvious is why are people driven to design high-level aspects (artistic signal processing) using a low-level design tool (C++).

Post

Well, it is perfectly possible to prototype in one language/platform/framework and to do the final implementation in another.

Post

rafa1981 wrote: Wed Jun 14, 2023 11:37 am Well, it is perfectly possible to prototype in one language/platform/framework and to do the final implementation in another.
Is it?

At the very least one'd expect a close implementational equivalence.

I believe that in most cases the implementations are not the same, and rather one must use library A in language X and library B in language Y and A is not exactly like B.

But I think APE (audio programming environment) was a good take.

Post

soundmodel wrote: Wed Jun 14, 2023 11:39 am
rafa1981 wrote: Wed Jun 14, 2023 11:37 am Well, it is perfectly possible to prototype in one language/platform/framework and to do the final implementation in another.
Is it?
Yes, it is.

The "hard part" (aside from, you know, actually doing the math) is implementing your DSP models in a form that can be reliably computed under real time constraints. That's usually where GC pauses kick you in the shorts. Being able to avoid those is absolutely necessary for this kind of work. It's why C and C++ are the kings of entire niches, why Rust is taken seriously even though Haskell already exists, and why languages like Nim are only catching on with hobbyists.

...But if you're still working out the math, you can relax the real time requirement and build a model that runs a little slower in exchange for more flexible routing and fully automatic memory management. You might not be able to play it on stage, but that part can come later, during a rewrite.
I hate signatures too.

Post

Super Piano Hater 64 wrote: Wed Jun 14, 2023 6:45 pm why Rust is taken seriously even though Haskell already exists
They aren't really comparable. I'm not sure what you're thinking here.

(And Nim is conceptually very cool, transpiling down to C, but there are some features with the language that leave me cold and I'm sure a number of other programmers as well.)
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post Reply

Return to “DSP and Plugin Development”