[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.ldt] Re: Role of EMF in LDT

Dear Ted.
Sorry for not answering your message earlier, I checked for replies the first week after I posted, and then missed your message, which was posted 14 days after mine.


Ted Carroll wrote:
The focus is about language development in general, with the full knowledge that if we don't produce something that adds value in the Java case, we're probably not doing the right thing.
I agree completly. I went somehow the same way in my thesis about DSL language semantics where I applied the techniques to Java, arguing that if you are not able to model the features of a language like Java easily, then you cannot build on peoples common understanding of language features. This argument would hold for LDF and Java as well.
If you are interested in the full argumentation, I can send you or one
of your colleagues a copy of the book.


Part of that is trying to arrive at a representation of an AST that is language independent without being so devoid of semantics that you can't build useful features on top of it.
Clear. You want more than just the trees, being able to keep informations about use/def relations, typing, constants, e.t.c. in a
language independent way as well. A little like Microsofts CLI (common
language infrastructure)


To that end, I'm familiar with EMF but I'm wanting to understand what you'd see as the advantages of using EMF and what, if any pitfals, you could imagine.
My company used EMF to represent ASTs of arbitrary DSLs, as well as the ASTs of the "Montages DSL" which is used to describe the semantics of
the single DSLs. Up to now we are very happy.


Given the fact that more and more big tools (such as IBMs new version of Rational) are implemented with EMF, I do not see pitfals, at least not, with respect to the aim of "arriving at a representation of an AST that is language independent without being completly devoid of semantics"

EMF is very well documented, and its very stable. In my projects as external consultant for Credit Suisse, I used repeatedly EMF instead of the proprietary formats provided by the new Rational version. (Rational
software modeler allows to directly import and export EMF) The results
where always positive.


To come to your question about the advantages:
I would see the largest advantage that the API of your AST is always done in a canonical way. From the UML model of your AST a specialized API is generated in a canonical way. Thus you have an API following your
datamodel (not like XML DOM, where you have one fixed API for all XML Schemata) but it is following it in a canonical way. In addition, you have the reflectifve API, but it is not primitive Java Reflection, but reflection over the EMF model of your Datamodel itself, thus using again the same canonical APIs.


Once you come to the point where your project will be concerned about a number of coexisting AST datamodels, or must be able to host existing datamodels of existing languages, then the reflective API is very useful.

The second advantage is the modularity of the EMF approach: you can split your datamodel into small packages, and develop semantics of the subpackages independently. Thus you may start with Java like languages, but keep the AST models of expressions and statements in separate projects. One may then replace the expressions, for instance with OCL expression. You then get Java, where expressions are defined with OCL, and statements are plain Java, just by replacing your expression module.

Can you please let me know of any disadvantage of using EMF in LDF you can think of? Maybe I can comment on them.

Best Regards,
Philipp Kutter
philipp@xxxxxxxxxx

www.montages.com
www.kutter.org



Ted Carroll BEA Systems, Inc.

Part of the project is making a a generalized AST that can be reused across multiple languages.
"Philipp W. Kutter, A4M AG" <philipp@xxxxxxxxxx> wrote in message news:d0n5ki$a3r$1@xxxxxxxxxxxxxxxxxx


Dear all.

Is the focus of this project to make the existing Java JDT Datamodel
easier reusable for Java like languages?

In this case, the project name should probably be "JDT Reusability"
which is a very interesting topic.

If the focus is about "language development" in general, the first question is how are the abstact syntax trees of the languages represented. Some people may hint to XML, but given the ease of mapping XML to UML and back, UML seems to me the first class choice for this.


Wouln't then EMF be the natural choice for supporting any data model for abstract syntax defined via UML?



By the way, this would not exclude the first goal, e.g. making the Java JDT Datamodel easier reusable for Java like languages. One could
do this by mapping the existing, highly optimized JDT Datamodel to some
EMF/UML defined model for some language. The design of such a pattern,
where the regular, normalized EMF generated implementation is
synchronized with an existing, highly tuned and optimized data-model
like the JDT data model. To do this design would be a highly
interesting task. Another topic would be to generate JDT like code from
EMF models.



I hope this is not completly out of scope, but we as a tiny company
are using EMF for all abstract syntax trees in a tool that generates a language implementation from its specification. It may be an
interesting choice for the here proposed Language Development Toolkit
as well.


Other tools that are built in this way are the new Rational Modeler, or
a number of Websphere products. I have only worked with the Modeler.

Best Regards,

Philipp Kutter
www.montages.com