numberOfLinesOfCode metric for smalltalk uses compiledMethod

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

numberOfLinesOfCode metric for smalltalk uses compiledMethod

Fabrizio Perin-3
Hi,
the metric numberOfLinesOfCode it doesn't work on an imported moose smalltalk model because it looks for the compiled method version to calculate the actual lines of code. I think we should seriously rethink the entire smalltalk importing and handling phase because it is not possible that only pharo can be imported and analyze: In all the places where a "isSmalltalk" method is invoked, if that means that you are going to look for smalltalk code in the image, we should change it with a method called "isSmalltalkCodeLoaded". This method can be set since the import phase.
 
What do you think?
 
Cheers,
Fabrizio
 
PS: I hope I can make the code I wrote to import Smalltalk available ASAP, that could be use as a start to create a image code independent parser/importer :)

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: numberOfLinesOfCode metric for smalltalk uses compiledMethod

Tudor Girba-2
Hi,

Retrieving numberOfLinesOfCode first looks up the property and computes it only afterwards. This happens with all lazy properties. The idea is that if you have access to the property computation at analysis time, you should use it. If not, then you should populate the property when you are creating the model.

^ self
lookUpPropertyNamed: #numberOfLinesOfCode
computedAs:[...]

Cheers,
Doru




On Tue, Mar 5, 2013 at 10:06 AM, Fabrizio Perin <[hidden email]> wrote:
Hi,
the metric numberOfLinesOfCode it doesn't work on an imported moose smalltalk model because it looks for the compiled method version to calculate the actual lines of code. I think we should seriously rethink the entire smalltalk importing and handling phase because it is not possible that only pharo can be imported and analyze: In all the places where a "isSmalltalk" method is invoked, if that means that you are going to look for smalltalk code in the image, we should change it with a method called "isSmalltalkCodeLoaded". This method can be set since the import phase.
 
What do you think?
 
Cheers,
Fabrizio
 
PS: I hope I can make the code I wrote to import Smalltalk available ASAP, that could be use as a start to create a image code independent parser/importer :)

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: numberOfLinesOfCode metric for smalltalk uses compiledMethod

Fabrizio Perin-3
Agree with you, I will compute that metric at import phase. Anyway the lazy loading of a property should not go to check in the image if the code is not there, so my observation of improving (of making more precise if you like) the computation of smalltalk code based properties/formatting/whateverItPopsUpIntoYourMind is still valid I think.
 
Cheers,
Fabrizio

2013/3/5 Tudor Girba <[hidden email]>
Hi,

Retrieving numberOfLinesOfCode first looks up the property and computes it only afterwards. This happens with all lazy properties. The idea is that if you have access to the property computation at analysis time, you should use it. If not, then you should populate the property when you are creating the model.

^ self
lookUpPropertyNamed: #numberOfLinesOfCode
computedAs:[...]

Cheers,
Doru




On Tue, Mar 5, 2013 at 10:06 AM, Fabrizio Perin <[hidden email]> wrote:
Hi,
the metric numberOfLinesOfCode it doesn't work on an imported moose smalltalk model because it looks for the compiled method version to calculate the actual lines of code. I think we should seriously rethink the entire smalltalk importing and handling phase because it is not possible that only pharo can be imported and analyze: In all the places where a "isSmalltalk" method is invoked, if that means that you are going to look for smalltalk code in the image, we should change it with a method called "isSmalltalkCodeLoaded". This method can be set since the import phase.
 
What do you think?
 
Cheers,
Fabrizio
 
PS: I hope I can make the code I wrote to import Smalltalk available ASAP, that could be use as a start to create a image code independent parser/importer :)

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: numberOfLinesOfCode metric for smalltalk uses compiledMethod

Tudor Girba-2
Yes, it would be nice to clean this part. I actually dislike the if-statements in the properties quite a bit.

Cheers,
Doru


On Mar 5, 2013, at 11:02 AM, Fabrizio Perin <[hidden email]> wrote:

> Agree with you, I will compute that metric at import phase. Anyway the lazy loading of a property should not go to check in the image if the code is not there, so my observation of improving (of making more precise if you like) the computation of smalltalk code based properties/formatting/whateverItPopsUpIntoYourMind is still valid I think.
>  
> Cheers,
> Fabrizio
>
> 2013/3/5 Tudor Girba <[hidden email]>
> Hi,
>
> Retrieving numberOfLinesOfCode first looks up the property and computes it only afterwards. This happens with all lazy properties. The idea is that if you have access to the property computation at analysis time, you should use it. If not, then you should populate the property when you are creating the model.
>
> ^ self
> lookUpPropertyNamed: #numberOfLinesOfCode
> computedAs:[...]
>
> Cheers,
> Doru
>
>
>
>
> On Tue, Mar 5, 2013 at 10:06 AM, Fabrizio Perin <[hidden email]> wrote:
> Hi,
> the metric numberOfLinesOfCode it doesn't work on an imported moose smalltalk model because it looks for the compiled method version to calculate the actual lines of code. I think we should seriously rethink the entire smalltalk importing and handling phase because it is not possible that only pharo can be imported and analyze: In all the places where a "isSmalltalk" method is invoked, if that means that you are going to look for smalltalk code in the image, we should change it with a method called "isSmalltalkCodeLoaded". This method can be set since the import phase.
>  
> What do you think?
>  
> Cheers,
> Fabrizio
>  
> PS: I hope I can make the code I wrote to import Smalltalk available ASAP, that could be use as a start to create a image code independent parser/importer :)
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"When people care, great things can happen."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: numberOfLinesOfCode metric for smalltalk uses compiledMethod

stephane ducasse

On Mar 5, 2013, at 10:17 PM, Tudor Girba <[hidden email]> wrote:

> Yes, it would be nice to clean this part. I actually dislike the if-statements in the properties quite a bit.

which ones?


>
> Cheers,
> Doru
>
>
> On Mar 5, 2013, at 11:02 AM, Fabrizio Perin <[hidden email]> wrote:
>
>> Agree with you, I will compute that metric at import phase. Anyway the lazy loading of a property should not go to check in the image if the code is not there, so my observation of improving (of making more precise if you like) the computation of smalltalk code based properties/formatting/whateverItPopsUpIntoYourMind is still valid I think.
>>
>> Cheers,
>> Fabrizio
>>
>> 2013/3/5 Tudor Girba <[hidden email]>
>> Hi,
>>
>> Retrieving numberOfLinesOfCode first looks up the property and computes it only afterwards. This happens with all lazy properties. The idea is that if you have access to the property computation at analysis time, you should use it. If not, then you should populate the property when you are creating the model.
>>
>> ^ self
>> lookUpPropertyNamed: #numberOfLinesOfCode
>> computedAs:[...]
>>
>> Cheers,
>> Doru
>>
>>
>>
>>
>> On Tue, Mar 5, 2013 at 10:06 AM, Fabrizio Perin <[hidden email]> wrote:
>> Hi,
>> the metric numberOfLinesOfCode it doesn't work on an imported moose smalltalk model because it looks for the compiled method version to calculate the actual lines of code. I think we should seriously rethink the entire smalltalk importing and handling phase because it is not possible that only pharo can be imported and analyze: In all the places where a "isSmalltalk" method is invoked, if that means that you are going to look for smalltalk code in the image, we should change it with a method called "isSmalltalkCodeLoaded". This method can be set since the import phase.
>>
>> What do you think?
>>
>> Cheers,
>> Fabrizio
>>
>> PS: I hope I can make the code I wrote to import Smalltalk available ASAP, that could be use as a start to create a image code independent parser/importer :)
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>>
>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Every thing has its own flow"
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
>
> "When people care, great things can happen."
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev