freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Devel] C++ API for FreeType - Portability


From: Manuel Bleichenbacher
Subject: RE: [Devel] C++ API for FreeType - Portability
Date: Sat, 12 Jan 2002 00:40:01 +0100

None of the major libraries in the open source world is written in C++.
That's for good reasons.

I don't dispute that rewriting freetype in C++ could improve its design and
interface, and make it easier to develop. However, C++ would make it much
harder to build applications composed of several libraries.

The portability discussion has circled around porting code from C++ compiler
A to C++ compiler B. That's not such a big issue with today's compilers. The
real problem is linking a library compiled with C++ compiler A and a library
compiled with C++ compiler B to the same application. It's impossible in
most cases.

Today's freetype library can be used in applications written in any
programming language and compiled with any compiler. That's because the C
struct layout and calling conventions are well defined and because their
run-time libraries are more or less standardized. If freetype is ported to
C++, it can no longer link to code compiled with a different C++ compilers,
and linking to other programming languages will be difficult because of the
hidden run-time libraries, template instantiations etc., which are required
by C++.

The situation arises for example on Solaris, where you find three different
popular compilers: Sun C++ 4.x, Sun C++ 5.x /6.x and gcc. They are
completely incompatible with regard to the produced code. They might compile
the same piece of C++ code but they generate code with incompatible object
layouts and their runtime libraries are in conflict. I know less about the
situation with Linux compilers but I could image that the situation is
similar with gcc 2.xx, gcc 3.xx and the Intel compilers.

And last but not least, a lot of embedded systems have no C++ compiler and
thus would have no new freetype versions.

So please, don't port freetype to C++ if you think it should stay one of the
major libraries used in diverse applications and any size of system. Port it
to C++ if you do it for educational purposes but do not otherwise care if
anybody else uses the library.

Wrappers for C++ (and Per, Python, Java, PHP etc.) are very much welcome, of
course.


-- Manuel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]