[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: EMF C++ runtime support?

Hi Reinhold,

Your EMF for .net project looks interesting. I must admit your that your list of challenges is not what I expected. I thought that the real complexity in a multi-platform EMF system would be in the code that binds all these implementations together rather than the C++ specific issues that you mentioned.

Coming to Java from the C++ world, I am not inclined to think the issues that you mentioned are insurmountable but as you well point out, the difficulty often lies in the functionally that has no direct correspondence between Java and C++.

I worked for a number of years on cross platform Solaris/Windows products written in C and C++ and in my personal experience C++ portability isn't a real worry once you understand the limitations of the compilers you are working with. I don't think it would be particularly difficult or complicated to extend the STL map and list templates to include EMF support. Introspection might be an issue though.

I guess I will need to take a look at your EMF for .net project to see what is involved.

Thank you all for your replies.

Regards,
Jose

-----

"Reinhold Bihler" <reinhold.bihler@xxxxxx> wrote in message news:fo0rvt$k18$1@xxxxxxxxxxxxxxxxxxxx
Jose,


C++ code generation and runtime support for EMF would be very cool! In the company
I am working for we use C++, Java and C# for the development of our products. There is
often the need to exchange modeled data between software components written in
different languages. That was one reason why I started the EMF4Net project Ed mentioned
(see also www.emf4net.org and wiki.eclipse.org/EMF4Net_Proposal for more information)
which basically tries to translate EMF's Java runtime to C#.


Translating EMF's runtime to C++ I see at least the following challenges:

- C++ lacks the concept of a garbage collector for automatic memory management. This
could be solved by using a smart pointer concept (see e.g. http://www.boost.org/libs/smart_ptr/smart_ptr.htm )


- C++ lacks imho a "real" standard library. I know there is the STL but in comparison to the
Java SDK API or the .Net SDK libraries the provided functionality is very limited. The EMF
runtime uses different list and map implementations. This is done by extending basic list and
map implementations. I am not sure how this could be done by extending the STL list and map
implementations (I am by no means a C++ guru but guess a real guru would find a way ;-).
Probably there are open source C++ libraries that could help to overcome C++ lack of standard
libraries. Apache has some very good C++ libraries like the C++ implementation of Xerces
and there is the boost project (http://www.boost.org/).


- <rant on>In the C/C++ world every compiler seems to follow its own standard so providing
a portable C++ library is a challenge on its own</rant off>. However, for a first step a
implementation for a wide spread compiler like gcc, Intel's or Microsoft's C++ compilers
would do. The libary could then be ported to other compilers later on.


The C++ code generation part is not a real problem as the EMF code generation and Java
code templates can be extended and modified easily.


So my conclusion is that a C++ implementation of EMF's runtime could be done especially as
the eclipse community and the EMF guys in special are very helpful. And there is also the
eclipse CDT project which might be used to develop and integrate a EMF4C++ implementation.


It is definitively a challenge but more a matter of the willingness to invest real efforts. It would
make a cool sub project to EMF and a wonderful contribution to the community. Hint, hint.. ;-)


Best regards,

Reinhold
"Ed Merks" <merks@xxxxxxxxxx> wrote in message news:fnvk0a$7oe$1@xxxxxxxxxxxxxxxxxxxx
Jose,


The EMF4Net guys did it for C# but that's a lot easier given how much C# is like Java:

http://www.eclipse.org/modeling/emft/?project=emf4net

I hope someone response to you query as well.  I'd be very interested!


Jose Hernandez wrote: Thanks Ed.

I will be interested to know if anyone reading this thread can offer any
hints as to how one might go about creating an C++ EMF runtime.

Jose

"Ed Merks" <merks@xxxxxxxxxx> wrote in message
news:fnvdsr$nga$1@xxxxxxxxxxxxxxxxxxxx

I'm not aware of specifics, but I do recall someone telling me a few years
back about their organizations's effort in this regard.

Jose Hernandez wrote:

Does anyone know if there is any such thing as a version of the EMF
runtime for C++?