Login  Register

Re: Microframeworks was: Re: Thank you so much for Pharo 3.0

Posted by Thierry Goubier on Oct 23, 2014; 3:06pm
URL: https://forum.world.st/Microframeworks-was-Re-Thank-you-so-much-for-Pharo-3-0-tp4786128p4786217.html



2014-10-23 16:38 GMT+02:00 Eliot Miranda <[hidden email]>:
Hi Thierry,

On Oct 23, 2014, at 12:36 AM, Thierry Goubier <[hidden email]> wrote:

> Le 23/10/2014 09:18, [hidden email] a écrit :
>>
>> On Thu, Oct 23, 2014 at 8:42 AM, Thierry Goubier
>> <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>
>> How long is long?
>
> 900 nodes in the AST seems to be the limit for the type of method SmaCC generates (cascading ifTrue:ifFalse:).
>
> Other limits exist (number of literals, for example). Unless you generate automatically some code, it's hard to hit them. Once you generate automatically, it's easy to hit them :P

Spur and Sista together lift these limits.  Spur provides 64k literals per method and Sista uses a bytecode set with effectively unlimited jumps.  We could possibly deploy the Sista bytecode set before the Sista optimizer.  Would you be interested in being a guinea pig?

Well, why not. I'm a bit behind stuff I have to do (should have done :() and I certainly have some code to test: probably all the SmaCC generated scanners have a scanToken method which is jump limited.

If you want to have a look, SmaCC (development version) in Pharo has a SmaCCSmalltalkCodeGenerator>>maxMethodLength which control the process. A good test would be to use the PythonParser, recompile it (LALR) and run the python tests.
 
Thierry



Eliot (phone)

>
>> Now, the point is to see all that as a stream, cut methods at
>> appropriate places and compile code under a WAComponent subclass.
>
> Yes. But then you need some kind of syntax to mark the start of a method. Change sets and dolphin packages use !! markers.
>
>> I don't know about SmaCC but I think I can do something with PetitParser
>> and Smalltalk compile:
>
> It's all done with RBParser. Since you're parsing Smalltalk, it's easier to do it that way (and probably a bit faster). And you're also playing with the AST, so you want to fall back to a well defined API for that AST (and visitors, and the like).
>
> Extending RBParser with a scheme to parse multi-methods files could be convenient.
>
> Unless you fall back on a variant of a changeset.
>
> Thierry
>