celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pepijn Noltes <pepijnnol...@gmail.com>
Subject Re: C++ support
Date Wed, 03 Aug 2016 08:55:57 GMT
Hi,

Thanks for the comments.

On Fri, Jul 29, 2016 at 8:45 AM Gerrit Binnenmars <
gerritbinnenmars@gmail.com> wrote:

> Hello Pepijn,
>
> Very interesting and indeed I think Celix can benefit from this. I also
> like the fact that the interface between C and C++ is very minimal and
> clear in this way.
> Looking at the code I noticed you need at least C++11, please state that
> explicitly.
>

Good point. Will add this.


>
> Questions that I have:
> 1. can I (or should I) deploy the C and C++ dependency manager in the same
> framework?
>
Yes you can and also should be able to do this. A big advantages of
service-oriented programming is that you can focus on the interfaces
instead of underlining implementations. Adding C++ (or other languages) to
the mix, should mean that you can provided/consume services in a preferred
language and the rest of the application can be unaware of this.


> 2. I notice you use the STL library. Does your code follow the guidelines
> for embedded/realtime programming and the use of STL?
>     (look on the Internet for discussion using new/delete and memory
> fragmentation, std::list<> usage and automatic resizing, no exception
> handling, no RTTI)
>

Not yet, but that is a valid remark. I think it is wise to disable RTTI and
exceptions in the C++ dependency manager and then is it up to users of the
dependency manager to decide to use exception in their code / services.
I did a quick search but could not find anything useful on std::list usage,
automatic resizing ect, could you provide some links. This can help in
focusing the discussion.



> 3. Should the header files not have a distinct extension?
>

For this I followed the google C++ guideline [1].  If I am correct, for
cmake it is crucial to have a clear discriminator between C (.c) and C++
(.cc) source files (translation units).

[1] https://google.github.io/styleguide/cppguide.html#Header_Files


>
> Another point I want to mention to everyone: there has been some activity
> to integrate RUST with Celix by Rogier Velting, see
> https://github.com/RogierWV/rust-celix
>
>
Thanks for pointing that out.


>
> With kind regards,
>
> Gerrit
>
> On Wed, Jul 27, 2016 at 9:51 PM, Pepijn Noltes <pepijnnoltes@gmail.com>
> wrote:
>
> > Hi All,
> >
> > I few day ago I pushed the Apache Celix C++ dependency manager [1] to the
> > development branch.
> > I have been busy with experimenting how to support other languages to
> Celix
> > for quite some time, but I finally convinced that this is best done with
> > use of the dependency manager.
> >
> > The C++ dependency manager is build on top of the C dependency manager.
> > I have chosen to add C++ support using C dependency manager approach
> > instead of wrapper the complete Celix API for the following reasons:
> >
> > 1. The Dependency Manager is arguably the most convenient way to interact
> > with services and covers most uses cases.
> > 2. It eliminates the necessity to port and maintain the rest of the
> (large)
> > API to C++.
> > 3. Because the relatively small codebase needed to build on top of the C
> > dependency manager this opens the possibility to support other languages
> > (e.g. D, Swift). In my opinion one of the benefits of C as programming
> > language it that can act as a common denominator for interoperability
> > between a range of languages.
> >
> > With the C++ dependency manager it is possible to provide C and C++
> > services, where C++ services are registered by providing the object
> > instance in combination with an interface name (more like in java). It is
> > also possible to specify C and/or C++ service dependencies.
> > If a service is register as a C++ service the C++ dependency manager will
> > ensure that a properties "lang=c++" is added. Also when C++ service
> > dependency is specified the C++ dependency manager ensures the filter is
> > extended with "(lang=c++)".
> >
> > I think Celix can benefit, in terms of popularity, from adding C++ as
> > supported language. I also still think that Apache Celix should primarily
> > focus on providing services in the form of C services (e.g. struct of
> > function pointers) as this should be the common denominator.
> >
> > Any comment or though are welcome. Also feel free to have a more in depth
> > look at the C++ dependency manager and let me know what you think.
> >
> > [1] https://github.com/apache/celix/tree/develop/dependency_manager_cxx
> >
> > Greetings,
> > Pepijn
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message