[Pharo-project] Breaking another dependency to Compiler (related to Traits I think)

Marcus Denker marcus.denker at inria.fr
Thu Aug 16 09:35:22 CEST 2012

On Aug 16, 2012, at 9:32 AM, Fernando Olivero <fernando.olivero at usi.ch> wrote:

> I've been using RB, which allows to recreate on demand the ast, but in
> my system i cached those values.
> ast := RBParser parseMethod: 'parsingAMethod
> 	| yeah |
> 	yeah := self doesAMethodNode remember        its            source.
> 	yeah
> 		ifTrue:[ ^ #hurray]'.
> ast source.
> ast formattedCode.
> ast := (Object>>#at:)	parseTree.
> ast source.
> ast formattedCode
> Regarding the memory usage, in my system only the methods which have a
> "method shape" opened in the IDE, store their ast, thus i cannot
> provide numbers of the overhead. But why should one extra object more
> per method be a problem?

It's not one object... it's a tree. I did once a system that stored the AST for each method
(uncompressed) in addition to what is there now (CompiledMethod).
The system was 120MB instead of 20MB. (based on Squeak 3.9)

Which means, even then smaller than Eclipse ;-)


Marcus Denker -- http://marcusdenker.de

More information about the Pharo-project mailing list