Hi guys,
Food for thoughts.
It's a long one, but it is literally the result of years of thinking and discussing Famix in our group.
This is still work in progress so that those who might want to participate have a chance to do it before everything is already decided.
You can call it a vision for the next Famix (and Fame incidentally)
Although the goal of Famix is to be able to model systems in any language, the reality of it is that it focuses very much on OO, and more precisely on ST and Java.
And even with only these two languages, it is already difficult.
Famix is the union of ST + Java which means unneeded complexity when you deal with only one of the two.
Same happen when considering something outside the current scope.
For example something as a C function calling another C function is currently represented as an invocation, which means it has a receiver (the object on which a message is sent, useless in C) and also a collection of candidates (whereas in C function names must be unique).
When working with different languages, mostly not OO, it started to annoy me, and I wanted to see how we could redesign a new Famix so that:
- we have a bare core metamodel that is really language independent
- something that is easily extensible so that one does not have to redefine basic stuff (what is a variable, a class, a method)
- no "hidden" associations as the declaredType of a FamixStructuralEntity
- it is completely model driven, which means we can regenerate all the code in Smalltalk, Java and other languages from the metamodel. Having Fame (and thus Famix) in Java helped a lot when I did VerveineJ. I can imagine having a C implementation of Fame could be nice to reuse old parsers based on Bison+Flex :-)
I had two other requirements steming from the way I see metamodels: primarily as conceptual representations of some domain. They should be as clear as possible about what is meant by the concepts and their relationships, and also it should be as close as possible from the human conception of the domain.
This implies:
- I want it to be typed. C and Java have types to guard the developer from making mistakes, I want types to clarify the meaning of the concepts, like defining an ontology
- I want it to have multiple inheritance, with as little restrictions as possible (typical multiple inheritance problems in programming languages) to try to be closer from the abstract conception of the domain.
In short, we are looking for the Graal, nothing new here :-)
Now the question is how far we can push it and how close can we get?
Discussing we had the idea of a GenericEntity, probably equivalent to the current FamixSourcedEntity.
We could have generic FunctionEntity, VariableEntity, ClassEntity inheriting from GenericEntity; MethodEntity inheriting from FunctionEntity.
And all these only stating consensual things like a class defines methods, a function defines variables.
Independent of that (meant to be used through multiple inheritance) we would have the idea that there are ContainerEntity, BehavioredEntity, TypedEntity, maybe even NamedEntity.
So that FunctionEntity (which is a GenericEntity) would also be a BehavioredEntity + a NamedEntity.
Invocation would occur between two BehavioredEntity
And we could create new entities by combining all these things.
For example, a JavaMethodEntity would inherit from MethodEntity + TypedEntity + ContainerEntity (may define classes)
A PascalProgram could be a GenericEntity+ContainerEntity (contains functions)+BehavioredEntity
All this would be declarative in the new Famix and translated in some way by Fame into different languages (lets concentrate on Pharo and Java for now).
In a first step, behaviour to be reused (like navigation between a ContainerEntity and its members) could be stored directly in the metamodel for each target language and then copied appropriately when generating actual code.
In a second step I also dream of using FAST (AST metamodeling, see http://youtu.be/dRr3WHOD3x4) to model the behaviour abstractly and then generate the code from that.
I believe this would introduce only two real changes to Moose: First Fame would have to allow for multiple inheritance, second MooseChef would have to be re-designed to allow for new queries (at least ContainerEntity, BehavioredEntity).
And of course, we would need to using it concretely to see whether it really helps considering new languages
So this is about it.
If you have any idea or comment on this, we will be glad to here from you.
If you want to participate, we will be even gladder because we are not that many and it is a lot of work.
nicolas
--
Nicolas Anquetil -- RMod research team (Inria)
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev