Fwd: Re: Re: Time to clean old compatibility code?
by Cyril Ferlicot D.
Once again I hit the wrong button… Forwarding.
-------- Message transféré --------
Sujet : Re: [Moose-dev] Re: Time to clean old compatibility code?
Date : Sun, 24 Sep 2017 10:45:42 +0200
De : Cyril Ferlicot D. <cyril.ferlicot(a)gmail.com>
Pour : Stéphane Ducasse <stephane.ducasse(a)inria.fr>
Le 24/09/2017 à 09:11, Stéphane Ducasse a écrit :
> can you send the code so that we really understand what is the double
> cache lookup?
numberOfStatements
<MSEProperty: #numberOfStatements type: #Number>
<MSEComment: 'The number of statements in a method'>
^ self
lookUpPropertyNamed: #numberOfStatements
computedAs: [
"This is needed for providing backward compatibility to exporters
that use NOS as a property name"
self
lookUpPropertyNamed: #NOS
computedAs: [
self mooseModel isSmalltalk
ifTrue: [
| parser |
parser := RBVisitorForFAMIXMetrics new.
parser processMethod: self usingImporter: nil inModel: nil.
parser numberOfStatements ]
ifFalse: [ self notExistentMetricValue ] ] ]
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr
> http://www.synectique.eu / http://www.pharo.org
> 03 59 35 87 52
> Assistant: Julie Jonas
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley,
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
>
>
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)list.inf.unibe.ch
> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
--
Cyril Ferlicot
https://ferlicot.fr
http://www.synectique.eu
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France
4 years, 10 months
Fwd: Re: Re: MooseDefaultState
by Cyril Ferlicot D.
I forward because I cliked "answer" instead of "answer all"…
-------- Message transféré --------
Sujet : Re: [Moose-dev] Re: MooseDefaultState
Date : Sat, 23 Sep 2017 20:30:14 +0200
De : Cyril Ferlicot D. <cyril.ferlicot(a)gmail.com>
Pour : Stéphane Ducasse <stephane.ducasse(a)inria.fr>
Le 23/09/2017 à 20:12, Stéphane Ducasse a écrit :
>
>
> cyril can you explain to me what is for queries?
> Did you check if there are smalldictionary?
>
In the MooseDefaultState there is 4 ivar.
entity : the entity using this state
attributes : a way to add dynamically properties to save. This
dictionary is never reset.
properties and queries : those two are caches that can be reset. They
save the result of long operations as #numberOfLinesOfCodes
But I do not know why we have two dictionaries instead of one and I
would like to know.
>>
>> Image without model : 263Mo
> Just loading the code takes that amount of space?
> Are you sure that we use all that?
>
This is what my Window's memory manager tell me. I'm sure we can remove
a lot of thing but I was waiting more progresses on the Bootstrap to
explore the possibility to reduce image size.
>> Image with model and default synectique caches : 650Mo
> What is a synectique caches?
>
After loading a model we launch the build of some caches in order to get
usable interfaces directly. Else some browsers can take 30sec to first
load then they take less than 1sec. To avoid this we generate some of
those caches at loading.
>> Image without model : 263Mo
>> Image with model : 589Mo
> so this is 6 mo so 1%?
>
The most interesting part is when we already use caches. The grow in
memory of the caches is reduced.
>
> Yes I would like to know.
> Do you know if the keys of “queries” clash with the keys of properties?
I tried in the application I am working on and there is none in this model.
Here is the script:
states := MooseModel allSubInstances first entities collect: #privateState.
MooseDefaultState compile: 'allPropertiesKeys
^ propertyCache keys'.
MooseDefaultState compile: 'allQueriesKeys
^ queryCache keys'.
properties := states flatCollectAsSet: #allPropertiesKeys.
queries := states flatCollectAsSet: #allQueriesKeys.
properties size = (properties \ queries) size. "true"
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr
> http://www.synectique.eu / http://www.pharo.org
> 03 59 35 87 52
> Assistant: Julie Jonas
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley,
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
>
>
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)list.inf.unibe.ch
> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
--
Cyril Ferlicot
https://ferlicot.fr
http://www.synectique.eu
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France
4 years, 10 months
About model level metrics
by Stéphane Ducasse
Hi
for certain metrics we need to compute the total amount of lines of code for the complete project.
FAMIXClass >> calculateARLCOMUnderstand
"Class LCOM LOC
C1 12 1000
C2 2 50
For C1 1000/1050 * 12
For C2 50/1050 * 2
"
self halt.
^ self TR_LoC / self mooseModel TR_totalNumberOfLinesOfCode * self TR_LCOM
Now I have a question because totalNumberOfLinesOfCode does exist on Model but on TypeGroup
I wrote it like that on FAMIXTypeGroup
TR_totalNumberOfLinesOfCode
<MSEProperty: #TR_totalNumberOfLinesOfCode type: #Number>
<derived>
<MSEComment: 'Total number of lines of code from Understand'>
^ self
lookUpPropertyNamed: #TR_totalNumberOfLinesOfCode
computedAs: [ (self sumNumbers: [ :each | each TR_LoC ]) asFloat ]
How can I access for example totalNumberOfLinesOfCode at the model level?
Stef
--------------------------------------------
Stéphane Ducasse
http://stephane.ducasse.free.fr
http://www.synectique.eu / http://www.pharo.org
03 59 35 87 52
Assistant: Julie Jonas
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France
4 years, 10 months
fortran parser
by Nicolas Anquetil
any fortran 2 MSE parser around here ?
nicolas
--
Nicolas Anquetil -- MCF (HDR)
Project-Team RMod
4 years, 10 months
Very simple SmaCC grammar for MSE files
by Gustavo Santos
Hi all,
I don't know if someone already did this but I was working with SmaCC from
scratch
so I did a very simple parser for MSE files. It parses all right with a
Java model
although I need to check and specialize the grammar for what I intend to do.
Cheers,
----
%start Model ;
%left <close>;
%glr;
<whitespace> : \s+ ;
<eol> : \r | \n | \r\n ;
<letter> : [a-zA-Z_] ;
<digit> : [0-9] ;
<integer> : \-? <digit>+ ;
<number> : \-? <digit>+ ( \. <digit>+ ) ? ( [eE] ( \- | \+ ) ? <digit>+ ) ?
;
<string> : \' [^\']* \' (\' [^\']* \')* ;
<boolean> : true | false ;
<open> : \( ;
<close> : \) ;
<simpleName> : <letter> ( <letter> | <digit> ) * ;
<qualifiedName> : <letter> ( <letter> | <digit> ) * ( \. <letter> (
<letter> | <digit> ) * ) * ;
Model : <open> ElementNodes <close> ;
ElementNodes : ElementNode | ElementNode ElementNodes ;
ElementNode : <open> Name Identifier AttributeNodes <close> ;
Identifier : <open> IdentifierToken Integer <close> ;
IdentifierToken : "id:" 'refToken';
AttributeNodes : | AttributeNode AttributeNodes ;
AttributeNode : <open> SimpleName ValueNodes <close> ;
ValueNodes : ValueNode | ValueNode ValueNodes ;
ValueNode : Primitive | Reference ;
Primitive : String | Integer | Number | Boolean ;
Reference : IntegerReference | NameReference ;
IntegerReference : <open> ReferenceToken Integer <close>;
NameReference : <open> ReferenceToken QualifiedName <close>;
ReferenceToken : "ref:" 'refToken';
Integer : <integer> 'integer';
Number : <number> 'number' ;
String: <string> 'string';
Boolean: <boolean> 'boolean';
Name : SimpleName | QualifiedName ;
SimpleName : <simpleName> 'simpleName';
QualifiedName : <qualifiedName> 'qualifiedName';
--
Gustavo Santos
http://gustavojss.github.io/
4 years, 10 months
Management of the children and parents entities in Moose
by Cyril Ferlicot D.
Hi,
Currently the implementation of #children in MooseEntity is really
fragile. In the current implementation, we select all the selectors
matching "all*s" and we merge the results of these methods.
This is fragile because we could have #allContainerFiles that would not
return children. Also it is possible that there is no method matching
this pattern for some children.
In the meanwhile, Anne, Jean-Christophe and Vincent worked in the usage
of the mse properties in order to build more generic algos. There is
currently a #childrenEntities and a #parentEntities methods to get the
children/parents based on the meta-model of the language. I think this
is now stable.
I will deprecate #childrenEntities and #parentEntities and rename them
#children and #parents now.
So, no need to implement some #children methods anymore :)
--
Cyril Ferlicot
https://ferlicot.fr
http://www.synectique.eu
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France
4 years, 10 months
FAMIXInvocation question
by Cyril Ferlicot D.
Hi,
I saw that in FAMIXInvocation we have an instance variable named
"receiverSourceCode". I think this is a bad idea to get variables like
this one because source code should be saved via source anchors. Also,
it is not used in Moose image.
I would like to replace the accessors by:
receiverSourceCode
^ self receiver sourceText
receiverSourceCode: aString
self deprecated: 'The source code of the receiver should not be saved
as a property. Instead access it via the receiver entity.'
Any objection? If I get none I'll do it soon to reduce memory consumption.
--
Cyril Ferlicot
https://ferlicot.fr
http://www.synectique.eu
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France
4 years, 10 months
Syntax highlighting for custom language on the GTInspector
by Ronie Salgado
Hi,
I have some custom programming languages (Lowtalk for low-level
programming, and Dastrel for GPU shaders) whose grammar are defined by
using PetitParser.
How can I add syntax highlighting support for them by using the GTInspector?
Best regards,
Ronie
4 years, 10 months
GTExamples as tests
by Peter Uhnák
Hi,
what is the best approach to use GTExamples as tests?
Should I create a new TestCase subclass that will look up all examples in
my project and run them?
Is there some existing infrastructure that I should just execute?
Thanks,
Peter
4 years, 11 months