Well, the first problem is that there is no "C++" abi to interface. Every C++ compiler has its own rules wrt mangling and other details.
Right, this is what I was hoping someone had a solution to. It looks like Rust provides a library for demangling LLVM names. I'm not sure how good an idea this ultimately is.
All hypothetically feasible, but difficult in practice.
The easiest way to do this is to also have a Free C++ compiler and keep it strictly aligned to FPC. (more or less like Embacadero does with C++ builder and Delphi)
Well, if that is indeed the best solution I do not see it happening very soon.
Easier might be to provide a linkage block compatible with FPC and its RTTI. This was at one point done for Java via GCJ and 'extern "Java"'.
[/quote]
What is a "linkage block" ?
Another might be exposing "class" information in C linkage blocks. This is why I had been asking about COM/GObject, though I think FreePascal could do far better than either.
I don't know what C linkage blocks are. You can write a C library that can parse FPC rtti.
COM and afaik GOBject doesn't work on RTTI level. You call functions to get info, and you can rewire them to whatever your implementation is.
Hopefully it can be seen that these two are kind of related.
Well, COM is more interprocess and about interoperability. GObject is just a library for languages that don't have a proper object model. Just start playing with it. As said you might be able to wrap a IDispatch interface around a gobject base class, and then be able to use it dynamically.
What about using FPC code from C/C++ without shoving everything through a dynamic library?
You can try. But in practice that is again through a procedural interface only.
A lot is easy to do for isolated cases. It is hard to do something that is universal wrt various targets, various languages and not reducing any of the languages involved to the lowest common denominator (read: sacrifice either C++ standard compliance or FPC Delphi compatibility)
There are few people working on this, so I guess it is just waiting for sb interested to get into it.