Re: How to start learning.
On Dec 22, 6:09 pm, Jeff Schwab <j...@schwabcenter.com> wrote:
Matthias Buelow wrote:
Bo Persson wrote:
Just if you want to publish the interface to other
languages. A C interface is the least common denominator,
which almost anyone can adapt to.
Which exposes the biggest problem with C++ -- it exposes an
interface noone can reliably talk to, not even other C++
code compiled by a different compiler.
This is a popular, but unfounded, accusation. C++ is portable
at the source level, just not at the compiled, binary level.
In practice, it's not even totally portable at the source level.
Of course, C++ isn't the only language to have that problem
either. In a certain sense, you unavoidably have it as soon as
there are two different code bases for the compiler; compilers
have bugs, and two different code bases will have different
bugs. In the case of C++, we also have the question of how well
they implement the standard, with code which compiled with g++
3.x failing to compile with 4.x, etc.
[1] If you do need binary compatibility, the C subset Bo
mentioned offers much cleaner support for it than (say) Java's
JNI [2], or C-based extensions to the scripting language du
jour.
That's because is supports a lot less.
In fact, I'm having trouble bringing to mind any language
other than C with the kind of binary compatibility you're
suggesting.
Fortran IV:-). Assembler.
1. Some implementations, e.g. GCC, do define versioned ABIs.
2. Even Java's byte-code is not forward compatible among JVM
versions.
You mean backward compatible, don't you? A modern JVM should
execute the older .class files.
Of course, even the underlying hardware has such problems: Sparc
added some instructions with v9, and if your code uses them, it
won't run on older processors. (The difference is, of course,
that we were promessed that this would never happen with the
JVM.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34