[Pharo-project] type-inference: it works!

Francisco Garau francisco.garau at gmail.com
Sat Mar 31 13:28:14 EDT 2012


Will come to you after my holiday break ...


On Saturday, 31 March 2012, Frank Shearar <frank.shearar at gmail.com> wrote:
> On 30 March 2012 23:56, Francisco Garau <francisco.garau at gmail.com> wrote:
>> Another interesting read, is from Peter Ahe who applied the same sort of
>> analysis to the Resilient Smalltalk.
>>
>> http://tinyurl.com/cz9kslu
>>
>> I have some slides explaining my work. I can email them to you, if you
>> wish.
>
> That would be great!
>
> One thing I've not taken the time to figure out is the relationship
> (if any) between the approach in Concrete Type Inference and Olin
> Shivers et al's k-CFA approach. k-CFA is also an abstract interpreter,
> but I don't know if it's just same in the name, or how the two
> approaches differ.
>
> Shivers also uses variants of CFA for things like tracking garbage
> collection. A recent paper by Matt Might titled "Abstracting Abstract
> Machines (http://matt.might.net/papers/vanhorn2010abstract.pdf) covers
> the various uses to which CFA can be put.
>
> frank
>
>> Cheers,
>> Francisco
>>
>>
>>
>> On 30 March 2012 22:19, Frank Shearar <frank.shearar at gmail.com> wrote:
>>>
>>> In case anyone's interested in the paper behind Francisco's work
>>> (thanks Francisco!), you can find "Concrete Type Inference: Delivering
>>> Object Oriented Applications" here:
>>> https://labs.oracle.com/technical-reports/1996/smli_tr-96-52.pdf
>>>
>>> Interestingly, typing 'Display boundBox' fails in Squeak trunk because
>>> "UndefinedObject won't understand #origin:corner:". Odd, since
>>> evaluating same will happily return a Rectangle. I'll look into it and
>>> see what I can find.
>>
>>
>>
>>
>>>
>>> frank
>>>
>>> On 30 March 2012 14:33, Francisco Garau <francisco.garau at gmail.com>
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 at 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:
>>> >
>>> > The code never goes through the #new method (it creates objects using
>>> > #basicNew and #@)
>>> > 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
>>> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>> >
>>> >
>>> >
>>> >
>>> >
>>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120331/754194f0/attachment-0001.html>


More information about the Pharo-dev mailing list