Giter VIP home page Giter VIP logo

fame's Introduction

Fame

CI

Fame is an meta-modelling framework for executable models.

Installation

To install the project on your Pharo image, execute the following script:

Metacello new
	githubUser: 'moosetechnology' project: 'Fame' commitish: 'development' path: 'src';
	baseline: 'Fame';
	load

To add the project to your baseline:

spec
	baseline: 'Fame'
	with: [ spec repository: 'github://moosetechnology/Fame:development/src' ]

Note you can replace the #master by another branch such as #development or a tag such as #v1.0.0, #v1.? or #v1.2.? .

Documentation

Export to mse

To export a model (or metamodel) in the mse format (for example to use FameJava and VerveineJ), execute the following code:

'/path/to/file.mse' asFileReference writeStreamDo: [ :writeStream | MyModel metamodel exportOn: writeStream ]

Export to JSON

String streamContents: [ :writeStream | MyModel metamodel exportOn: writeStream usingPrinter: FMJSONPrinter ]

Version management

This project use semantic versioning to define the releases. This means that each stable release of the project will be assigned a version number of the form vX.Y.Z.

  • X defines the major version number
  • Y defines the minor version number
  • Z defines the patch version number

When a release contains only bug fixes, the patch number increases. When the release contains new features that are backward compatible, the minor version increases. When the release contains breaking changes, the major version increases.

Thus, it should be safe to depend on a fixed major version and moving minor version of this project.

Smalltalk versions compatibility

Version Compatible Pharo versions
development Pharo 80

Contact

If you have any questions or problems do not hesitate to open an issue or contact cyril (a) ferlicot.me

fame's People

Contributors

anneetien avatar aranega avatar badetitou avatar cafekrem avatar clotildetoullec avatar enwiro avatar fouziray avatar fuhrmanator avatar gabriel-darbord avatar georgeganea avatar girba avatar guillep avatar hogoww avatar jecisc avatar juliendelplanque avatar larcheveque avatar lionelakue avatar mahugnon avatar nicolasanquetil avatar pavel-krivanek avatar sbragagnolo avatar seandenigris avatar sergestinckwich avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fame's Issues

exportOn: gives an MSE file with `ref: String` instead of a `ref: <integer>`

I'm experimenting with generating metamodels using FamixNG. I generated an MSE from it using 'FamixTypeScriptMetamodel.mse' asFileReference writeStreamDo: [ :writeStream | FamixTSModel metamodel exportOn: writeStream ], and got some results that don't look like they respect the grammar (see the (type: (ref: String))) line below). Because of this, my parser can't read it. Is this a bug? Maybe my metamodel is missing some entities (I can't find anything with (name 'String'))?

(
	(FM3.Package (id: 1)
		(name 'Tagging')
		(classes
			(FM3.Class (id: 2)
				(name 'Category')
				(abstract false)
				(package (ref: 1))
				(superclass (ref: 3))
				(properties
					(FM3.Property (id: 4)
						(name 'name')
						(class (ref: 2))
						(container false)
						(derived false)
						(multivalued false)
						(type (ref: String)))
					(FM3.Property (id: 5)
						(name 'markedTags')
						(class (ref: 2))
						(container false)
						(derived false)
						(multivalued true)
						(opposite (ref: 6))
						(type (ref: 7)))))

I'm attaching the entire MSE file of the Metamodel for more info (there are other cases where ref: is Number, etc.
FamixTypeScriptMetamodel.mse.txt

FM3Type>> traits does not use opposite

The FM3Type has a Set to hold the traits.
Whereas it is good as a first solution, it would be nice to use FMMultiValue as we did for packages etc.

The idea is to implement a method/attribute named users in FM3Trait that will be the opposite of the FM3Type>>traits

Should release Fame 2.0.0

We should release a 2.0.0 version since the current dev version, used in Famix, has traits and Json exporter.
So it will be easier in the future to manage Fame evolution.
What is your opinion @ClotildeToullec?

Allow properties to have a default value

To avoid properties evaluated as nil when it does not make sense, or nil checks like

isClassSide
    ^ classSide ifNil: [ ^ false ]

---> create FmxMBBehavior>#property:type:defaultValue:

Impossibility to have only direct (or local) -used- traits via an FM3Trait

It is impossible to have only the traits used directly (or locally) via an FM3Trait. That is to say that the "traits" method of an FM3Trait returns its entire trait usage chain.

For example, for the FM3Trait: FAST-Core-Model.TNullPointerLiteral, its method returns 4 traits going back to Moose-Query.TEntityMEtaLevelDependency.
image

While the equivalent Pharo trait, via "implementingClass traits", returns only the direct FASTTLiteral trait. But be careful, it returns a Pharo trait and not an FM3Trait.

image

In conclusion, the problem is not to be able to access the FM3Traits used by another FM3Trait without going through the Pharo trait and using a hack.

Make FMMany more memory efficient by sharing a default value

I did some tests in an image and I found this:

FamixJavaEntity allSubInstances size. "1.941.951"

FMSlotMultivalueLink allInstances size. "3.454.420"

(FMSlotMultivalueLink allInstances select: #isEmpty) size. "2.411.735"

So I have an image with 2 millions entities. In total they have 3.5millions collections to point to other entities. But out of those, 2.4 millions are empty which means we have collections taking up space for nothing.

My idea is to improve the FMMany so that it does not initialize itself with a FMSlotMultivalueLink but with a read only singleton of a Null entity that would get replaced the first time we add an element. Like this we would get only one instance in the image.

FMMetaMetaModel new

FMMetaMetaModel does not allows new, arguing that it must be accessed through a singleton "default".
This means that we cannot really define new meta-meta models.
We should think in an other way to deal with the single-metameta-model. Before there was a meta repository that i see has been deprecated. We should discuss on how to solve this problem

FM3Constants unexpected usages

FM3Constants is used as shown in the image.

image

MetaModel / MetaMetaModel and ModelExporter. Meaning that our 3 levels of Meta are all tangled with a specific model.

FMMetaMetaModel initialization uses FM3

During the initialization of a FMMetaMetaModel we are executing an "updateCache" method that does as follow at the level of the FMMetaModel:
updateCache
nameDict := (FM3Constant constants collect: [ :const | const name asString -> const ]) asDictionary.
typeDict := (FM3Constant constants collect: [ :const | const class -> const ]) asDictionary.
self elements do: [ :each | self updateCacheWith: each ].

This couple the FM3 specific meta model to the metaMetaModel.

JSON error in model export

When exporting, the current behavior is:

  • Begin entity = print "FM3" : "..."
  • Serial = print "id" : aNumber,
  • Print properties

The issue is occurring when an entity has no properties: the coma after the id number is not followed by anything before closing the object. That is not correct in JSON.

Exporting metamodel

During the exporting of a metamodel, whatever object in moose properties that do not belongs to the meta model and is not a simple object (string / bool / etc) is ignored without warning nor error.

It may be a good behaviour for some usages, but we should allow the activation of exceptions (or deactivation), for the process of development, to ensure that we can understand what is not being exported, when and why.

It could be also nice to article some secondary serializer for those objects that we cannot export with MSE such as Fuel or Ston. Like this we can keep our "boundary" objects (such as an smacc ast )

Missing tests on Links

FMMultivalueLink should be tested with basic Collection API like collect:, select:, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.