I think they are not comparable. They both try to do Type-Inference. But... what is a Type? Roel Typer works backwards. My TiEngine works forwards. Roel Typer works backwards because it starts analysing a method a finds a message send, lets say "anObject setup". It then asks the question, who implements the method #setup and if it finds 13 different classes, then those are the "Type" of the anObject. My TiEngine starts executing code without actually executing anything. It simulates execution making sure it goes through all the possible execution paths. That's is not always possible, so some compromise should be made. Reflection is the killer of any sort of static analysis. - Francisco On 30 March 2012 17:17, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Ah okays. Have you made some comparison with the result of Roel Typer? That would be an interesting point to compare with.
cheers, Alexandre
On 30 Mar 2012, at 09:33, Francisco Garau wrote:
No unit tests, sorry...
Is not profiling, it's abstract intrepretation using types instead of objects.
- Francisco
On 30 Mar 2012, at 15:15, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Hi Francisco,
I've tried your implementation. It seems to work in Pharo 1.4. Do you have unit test somewhere? How does your profiler work? From what you have said in your email, it seems you are profiling the execution. Is that true?
Cheers, Alexandre
On 29 Mar 2012, at 18:47, Francisco Garau wrote:
Load the attached ChangeSets: first Ti-Engine and then Ti-Support.
You could then evaluate the below expressions -- watch the Transcript to see which methods are being analysed.
TiSystem current reset. string := '3 + 4'. Compiler new analyze: string in: nil to: nil notifying: nil ifFail: [1]. "=> return {<SmallInteger>} "
TiSystem current reset. string := 'Display boundingBox'. Compiler new analyze: string in: nil to: nil notifying: nil ifFail: [1]. "=> return {<Rectangle origin: <Point x: <SmallInteger> y: <SmallInteger>> corner: <Point x: <SmallInteger> y: <SmallInteger>>>}"
TiSystem current explore.
Analysing 'Display boundingBox' shows a couple of surprises:
1. The code never goes through the #new method (it creates objects using #basicNew and #@) 2. Object code goes through Object>>value but knowing that the implementation just answers self, it could be easily optimised.
I will try to package it more nicely under Monticello -- there are still a few rough edges that need to be polished before getting it to the same state it was in 2001...
Cheers, Francisco <Ti-Engine.2.cs><Ti-Support.2.cs>
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.