On Thu, 2002-10-17 at 22:00, Paul Davis wrote:
> thus guaranteeing that no instruments can be written in other
> languages. for all the mistakes the GTK+ crew made, their design to
> use C as the base language so as to allow for other languages to
> provide "wrappers" was a far-sighted and wise choice. OTOH, i will
> concede that the real-time nature of most synthesis would tend to rule
> out most of the languages of interest.
nick <nixx(a)nixx.org.uk> writes:
Basically, your instrument would be a c++ class, but
whatever you do
_inside_ that class is up to you.. no need to use objects inside that.
And basically it just cleans up all the code. I'm really having trouble
seeing the drawbacks (other than one needs a c++ compiler installed, and
the fact that c++ projects take longer to compile). oh, and the c++
class could always include (link to) an assembler version of your code..
The main drawback to using C++ subroutine linkage in today's Linux
environment is the unstable ABI. This has caused many problems when
trying to call binary libraries built using different compilers or
sometimes even different compiler options. Exception handling is a
particularly thorny issue.
The result is a debugging nightmare. Using incompatibly compiled C++
libraries may cause random SEGV's, which are often very hard to debug.
The compilers don't seem to leave enough information in the binaries
they produce for maintainers to determine exactly what ABI options
were used.
The Ardour project struggled so much with this problem that Paul Davis
eventually decided to distribute (almost) all the C++ libraries he
uses in source, statically linking them to ensure that they are always
compiled identically. This draconian solution was not adopted for
casual reasons.
Please note that these problems are deadly to any proposal for a
standard plugin interface.
We can all hope that ABI instabilities will eventually become a thing
of the past, perhaps once GCC version 3 becomes widely adopted. But,
there is no proof that this will happen. Right now, the Linux world
is full of incompatible C++ compiler implementations.
Regards,
--
Jack O'Quin
Austin, Texas, USA