#1 2014-10-07 18:06:02

WayneBailey
Member
Registered: 2013-06-12
Posts: 15

Building service/client modules with different, incompatible compilers

Offline

#2 2014-10-07 18:36:21

sascha
Administrator
Registered: 2012-05-04
Posts: 45

Re: Building service/client modules with different, incompatible compilers

Offline

#3 2014-10-08 13:31:39

WayneBailey
Member
Registered: 2013-06-12
Posts: 15

Re: Building service/client modules with different, incompatible compilers

The status quo is adequate for our current needs; however, having plugin compatibility across compilers offers unique opportunities.

Herb’s proposal looks quite promising, but as you point out, it’ll be many years before we see it in practice. In the meantime, John’s CppComponents demonstrates there are intermediate alternatives. My major concern about CppComponents is the overhead of runtime mediation across compiler interfaces. This is eliminated by Herb’s proposal. But as Herb points out his solution also has performance and flexibility costs. Thus he proposes C++ ABIs be specified rather than being the default. 

If CppMicroServices is to support cross-compiler plugins, it makes sense (as you point out) to have a mechanism to opt into this feature for performance and backward compatibility reasons. Although remote services could be used, it seems to be overkill for this purpose. Can you elaborate on how declarative services would be used to achieve this?

As you point out, CppComponents intrudes on the CppMicroServices service interface declaration. I believe this is because you’re both addressing the same problem, and it appears you’re both using the same design pattern. Which means there’s an opportunity to combine the two. However, such a blending would not be at a superficial level. You may wish to consider collaborating with John in this regard. He indicated a desire to implement a “package manager” (which you have) and you’d like cross-compiler plugins (which he has). Just a thought.

If CppMicroServices had cross-compiler plugin support that could be selectively “switched” on/off, then a light-weight verification mechanism to detect compiler version could be used to determine when to use this feature. Thus making this support transparent.

-Wayne

Offline

#4 2014-10-09 13:34:00

WayneBailey
Member
Registered: 2013-06-12
Posts: 15

Re: Building service/client modules with different, incompatible compilers

Offline

#5 2014-10-24 00:03:29

sascha
Administrator
Registered: 2012-05-04
Posts: 45

Re: Building service/client modules with different, incompatible compilers

Thanks a lot for your input. While it is not on my short-term todo list, I will keep monitoring the CppComponents project and eventually contact its developer. The hourglass pattern you mentioned also looks promising to me (it actually was in my original list of possible approaches).

The approach with declarative services + C-style service interfaces (plus maybe a convenience header-only C++ interface wrapping the C-style interface) could work in a restricted scenario where modules communicate exclusively via service interfaces and do not make any CppMicroServices API calls at all. The declarative services module itself would take care of the service wiring by reading the xml files from the modules and taking care of the CppMicroServices API calls on behalf of the modules. Hence such modules would not have any linker dependencies to the CppMicroServices library (at least not to its C++ API). Dependencies to other modules would only involve the C API for the C-style service interface. Therefore no ABI incompatibilities would exist. Currently, the module initialization code would still force a linker dependency on the CppMicroServices library, but this is going to change soon. So far the theory...

In practice I would still be concerned about different runtimes needed by modules compiled with different compilers. E.g. on Windows, one would get dependencies to different versions of msvcrt.dll, msvcr*.dll, etc. libraries which use different heaps. Correct memory management across module boundaries would have to be enforced (at least in the service interfaces).

Offline

#6 2014-10-24 13:49:19

WayneBailey
Member
Registered: 2013-06-12
Posts: 15

Re: Building service/client modules with different, incompatible compilers

Offline

Board footer

Powered by FluxBB