How to silently generate and remove code

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

Re: How to silently generate and remove code

stepharo
Thierry

this means that generating ring objects would help you?
I guess so.

stef

Le 30/3/15 16:25, Thierry Goubier a écrit :
A use case:

the ability to test and debug the code generation part of SmaCC.

SmaCC, when compiling a parser, generates dozens of classes and hundreds of methods, some of those very long, as a sequence of refactorings (and optimise them).

Then SmaCC apply them all in one step.

I'd dream of having a virtual environment where I could test-compile and check all those methods, via a system browser, before they are compiled.

Thierry

2015-03-30 9:10 GMT+02:00 Marcus Denker <[hidden email]>:

> On 29 Mar 2015, at 10:32, stepharo <[hidden email]> wrote:
>
> Before that I would like that the compiler outputs classes definition in an environment (that can be the default one) but that can be the one
> I want and specified from the outside of the compiler.

For installing, it is the ClassInstaller that does that (and yes, it has an environment).

What the compiler does not have is to look up references e.g. to symbols regarding to an environment, but that is because we
don’t have that concept right now in the system in general. globals/class vars are requested from the class (which defines its environment).

So in general, we first need a use case, else it is not clear what to do…


        Marcus


Reply | Threaded
Open this post in threaded view
|

Re: How to silently generate and remove code

stepharo
In reply to this post by Marcus Denker-4


Le 30/3/15 09:10, Marcus Denker a écrit :

>> On 29 Mar 2015, at 10:32, stepharo <[hidden email]> wrote:
>>
>> Before that I would like that the compiler outputs classes definition in an environment (that can be the default one) but that can be the one
>> I want and specified from the outside of the compiler.
> For installing, it is the ClassInstaller that does that (and yes, it has an environment).
>
> What the compiler does not have is to look up references e.g. to symbols regarding to an environment, but that is because we
> don’t have that concept right now in the system in general. globals/class vars are requested from the class (which defines its environment).
>
> So in general, we first need a use case, else it is not clear what to do…

Sc1:
     Imagine that Max wants to load code that if the code is incomplete
or contains Undefined the code is not loaded at all.
     To do so we need to be able to compile the code in a separate
namespace. Then on success copy/install to another one.

sd := SystemDictionary new.
OpalCompiler
     inputEnvironment: Smalltalk globals
     outputEnvironment: sd.

This shows that probably sd should be linked to Smalltalk globals to be
able to find new added class (that will not be found in sd).

Sc2:
     We should be able to compile Opal beside Opal in a sister
environment, modify it by compiling method there.

Sc3:
     Guillermo's Tornado Infrastructure.
     Instead of installing, copying manually and hacking, probably that
     guillermo needs a compiling infrastructure were we can say
         - look for literals in this special array or environemtn
         - look for globals in this one
         - put the returns in the other literalas environment and globals.

Stef








Reply | Threaded
Open this post in threaded view
|

Re: How to silently generate and remove code

Thierry Goubier
In reply to this post by stepharo
Le 04/04/2015 18:02, stepharo a écrit :
> Thierry
>
> this means that generating ring objects would help you?

Maybe. Or maybe unifying Ring with what RB already does with its models
(RBClass, etc...), and ensuring that Opal can work with those (at least
do the bindings part, count the literals, etc...).

I feel like Pharo has three competing ways of modeling software items:
MCDefinition stuff, Ring, RB stuff.

Thierry

> I guess so.
>
> stef
>
> Le 30/3/15 16:25, Thierry Goubier a écrit :
>> A use case:
>>
>> the ability to test and debug the code generation part of SmaCC.
>>
>> SmaCC, when compiling a parser, generates dozens of classes and
>> hundreds of methods, some of those very long, as a sequence of
>> refactorings (and optimise them).
>>
>> Then SmaCC apply them all in one step.
>>
>> I'd dream of having a virtual environment where I could test-compile
>> and check all those methods, via a system browser, before they are
>> compiled.
>>
>> Thierry
>>
>> 2015-03-30 9:10 GMT+02:00 Marcus Denker <[hidden email]
>> <mailto:[hidden email]>>:
>>
>>
>>     > On 29 Mar 2015, at 10:32, stepharo <[hidden email]
>>     <mailto:[hidden email]>> wrote:
>>     >
>>     > Before that I would like that the compiler outputs classes
>>     definition in an environment (that can be the default one) but
>>     that can be the one
>>     > I want and specified from the outside of the compiler.
>>
>>     For installing, it is the ClassInstaller that does that (and yes,
>>     it has an environment).
>>
>>     What the compiler does not have is to look up references e.g. to
>>     symbols regarding to an environment, but that is because we
>>     don’t have that concept right now in the system in general.
>>     globals/class vars are requested from the class (which defines its
>>     environment).
>>
>>     So in general, we first need a use case, else it is not clear what
>>     to do…
>>
>>
>>             Marcus
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: How to silently generate and remove code

Ben Coman
In reply to this post by stepharo


On Sun, Apr 5, 2015 at 12:01 AM, stepharo <[hidden email]> wrote:


Le 30/3/15 09:10, Marcus Denker a écrit :

On 29 Mar 2015, at 10:32, stepharo <[hidden email]> wrote:

Before that I would like that the compiler outputs classes definition in an environment (that can be the default one) but that can be the one
I want and specified from the outside of the compiler.
For installing, it is the ClassInstaller that does that (and yes, it has an environment).

What the compiler does not have is to look up references e.g. to symbols regarding to an environment, but that is because we
don’t have that concept right now in the system in general. globals/class vars are requested from the class (which defines its environment).

So in general, we first need a use case, else it is not clear what to do…

Sc1:
    Imagine that Max wants to load code that if the code is incomplete or contains Undefined the code is not loaded at all.
    To do so we need to be able to compile the code in a separate namespace. Then on success copy/install to another one.

sd := SystemDictionary new.
OpalCompiler
    inputEnvironment: Smalltalk globals
    outputEnvironment: sd.

This shows that probably sd should be linked to Smalltalk globals to be able to find new added class (that will not be found in sd).

Sc2:
    We should be able to compile Opal beside Opal in a sister environment, modify it by compiling method there.

Sc3:
    Guillermo's Tornado Infrastructure.
    Instead of installing, copying manually and hacking, probably that
    guillermo needs a compiling infrastructure were we can say
        - look for literals in this special array or environemtn
        - look for globals in this one
        - put the returns in the other literalas environment and globals.

Stef


What would be exciting is in a "host-image" being able to generate an empty special-object Root-Object  (like is held by the VM) as a guest-image inside the host-image, so you can push core elements into it until the guest is a running minimal-image, but standard tools can be used to debug it.  I guess this might be like the simulator (which I haven't used) - but maybe that just simulates the VM so there are differences. 
</dreaming>

btw (and just for interest), are there any tutorials for running the simulator.  A quick google didn't bring up anything useful.

cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: How to silently generate and remove code

Luc Fabresse

2015-04-05 15:07 GMT+02:00 Ben Coman <[hidden email]>:

What would be exciting is in a "host-image" being able to generate an empty special-object Root-Object  (like is held by the VM) as a guest-image inside the host-image, so you can push core elements into it until the guest is a running minimal-image, but standard tools can be used to debug it.  I guess this might be like the simulator (which I haven't used) - but maybe that just simulates the VM so there are differences. 
</dreaming>

you should read Guille's PhD because this is exactly what he did ;-)

Luc
 

btw (and just for interest), are there any tutorials for running the simulator.  A quick google didn't bring up anything useful.

cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: How to silently generate and remove code

Marcus Denker-4
In reply to this post by Thierry Goubier

> On 05 Apr 2015, at 10:46, Thierry Goubier <[hidden email]> wrote:
>
> Le 04/04/2015 18:02, stepharo a écrit :
>> Thierry
>>
>> this means that generating ring objects would help you?
>
> Maybe. Or maybe unifying Ring with what RB already does with its models (RBClass, etc...), and ensuring that Opal can work with those (at least do the bindings part, count the literals, etc...).
>
> I feel like Pharo has three competing ways of modeling software items: MCDefinition stuff, Ring, RB stuff.
>

Yes! We should look at unifying RB and Ring…

        Marcus
Reply | Threaded
Open this post in threaded view
|

Re: How to silently generate and remove code

stepharo
Yes we should first remove the fourth ways :) PseudoClass.
We will get there.

Stef


Le 7/4/15 09:38, Marcus Denker a écrit :

>> On 05 Apr 2015, at 10:46, Thierry Goubier <[hidden email]> wrote:
>>
>> Le 04/04/2015 18:02, stepharo a écrit :
>>> Thierry
>>>
>>> this means that generating ring objects would help you?
>> Maybe. Or maybe unifying Ring with what RB already does with its models (RBClass, etc...), and ensuring that Opal can work with those (at least do the bindings part, count the literals, etc...).
>>
>> I feel like Pharo has three competing ways of modeling software items: MCDefinition stuff, Ring, RB stuff.
>>
> Yes! We should look at unifying RB and Ring…
>
> Marcus
>


12