[PD] C++ for reusable dsp lib - or better use C?

Jonathan Wilkes jancsika at yahoo.com
Wed Feb 22 18:05:48 CET 2012


----- Original Message -----

> From: Mathieu Bouchard <matju at artengine.ca>
> To: Hans-Christoph Steiner <hans at at.or.at>
> Cc: pd-list at iem.at; IOhannes m zmoelnig <zmoelnig at iem.at>
> Sent: Wednesday, February 22, 2012 11:44 AM
> Subject: Re: [PD] C++ for reusable dsp lib - or better use C?
> 
> Le 2012-02-22 à 09:37:00, Hans-Christoph Steiner a écrit :
> 
>>  STL, Qt, and Boost are all only used in C++.
> 
> Qt is also available for Ada, C#, D, Haskell, Harbour, Java, Lisp, Lua, Pascal, 
> Perl, PHP, Python, QML, R, Ruby, Scheme, ... and even Tcl.

That's great news.

Would you mind giving me the link to the stable, actively maintained 
library that makes Qt available for Tcl?  I look forward to testing it out.

> 
> See http://en.wikipedia.org/wiki/Qt_%28framework%29#Bindings
> 
> now for the others...
> 
> STL and Boost are different. While Qt's interface (API) consists of features 
> that are in many languages (or have very close equivalents), STL uses several 
> features that are quite C++-specific and at odds with how other programming 
> languages work. Other languages have already their own library covering the same 
> ground as the STL, though usually in a quite different way and usually not that 
> efficiently. Boost goes further in the direction of using all the C++ features 
> that exist and it's at least as impossible to port.
> 
> This shows a rift between libraries with least-common-denominator interfaces 
> that are somewhet easy to port to many languages (incl Qt), and libraries that 
> are deeply entrenched in a language to get the best of it. The latter is more 
> common in C++, because least-common-denominator tend to be a same small set of 
> data types (int,float,string,array), basic OOP features, and that's all, 
> while C++ has long expanded beyond « C with Classes » to include templates and 
> stuff.
> 
> Templates can't be easily wrapped because their point is to generate code 
> on-the-fly as the programmer is programming. Wrapping that kind of library means 
> reducing the flexibility and/or efficiency, by precompiling some use-cases of 
> templates, and forbidding the rest. Otherwise, you'd need something that can 
> recompile C++ templates on-the-fly in another language, and I haven't seen 
> that yet.
> 
> Actually, one can do similar tricks in plain C with macros, but those same 
> caveats appear as with templates.
> 
> ______________________________________________________________________
> | Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> http://lists.puredata.info/listinfo/pd-list
> 



More information about the Pd-list mailing list