About RBCompiler

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

About RBCompiler

SergeStinckwich
I'm trying to port QuasiQuote package from Lukas Renggli to Pharo 3.0/4.0.
This package use the RBCompiler class from the AST-Compiler package
available here:
http://source.lukas-renggli.ch/helvetia

If I understand RBCompiler, this is a Compiler that use RB parser nodes.
I guess this is something that is no more relevant with the new Opal compiler ?

--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] About RBCompiler

Marcus Denker-4

> On 22 Nov 2014, at 18:17, Serge Stinckwich <[hidden email]> wrote:
>
> I'm trying to port QuasiQuote package from Lukas Renggli to Pharo 3.0/4.0.
> This package use the RBCompiler class from the AST-Compiler package
> available here:
> http://source.lukas-renggli.ch/helvetia
>
> If I understand RBCompiler, this is a Compiler that use RB parser nodes.
> I guess this is something that is no more relevant with the new Opal compiler ?
>

Yes, this is the PetitParser based Smalltalk parser that created RB ParseNodes.

Opal has a pluggable architecture for the parser, right now it just uses the hand-written
RB Parser that came with the refactoring browser.

It would be very nice small experiment to  plug in the Petitparser based one.

Especially interesting: Would it be much slower?

        Marcus


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] About RBCompiler

SergeStinckwich
On Sun, Nov 23, 2014 at 10:13 AM, Marcus Denker <[hidden email]> wrote:

>
>> On 22 Nov 2014, at 18:17, Serge Stinckwich <[hidden email]> wrote:
>>
>> I'm trying to port QuasiQuote package from Lukas Renggli to Pharo 3.0/4.0.
>> This package use the RBCompiler class from the AST-Compiler package
>> available here:
>> http://source.lukas-renggli.ch/helvetia
>>
>> If I understand RBCompiler, this is a Compiler that use RB parser nodes.
>> I guess this is something that is no more relevant with the new Opal compiler ?
>>
>
> Yes, this is the PetitParser based Smalltalk parser that created RB ParseNodes.
>
> Opal has a pluggable architecture for the parser, right now it just uses the hand-written
> RB Parser that came with the refactoring browser.


Ok, thank you for the explanation, Markus.
I'm able to parse Smalltalk code containing QuasiQuote and generate an
RB parsenodes AST.
How I can plug my AST tree to generate IR and bytecodes ?

--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] About RBCompiler

Marcus Denker-4

> On 23 Nov 2014, at 17:37, Serge Stinckwich <[hidden email]> wrote:
>
> On Sun, Nov 23, 2014 at 10:13 AM, Marcus Denker <[hidden email]> wrote:
>>
>>> On 22 Nov 2014, at 18:17, Serge Stinckwich <[hidden email]> wrote:
>>>
>>> I'm trying to port QuasiQuote package from Lukas Renggli to Pharo 3.0/4.0.
>>> This package use the RBCompiler class from the AST-Compiler package
>>> available here:
>>> http://source.lukas-renggli.ch/helvetia
>>>
>>> If I understand RBCompiler, this is a Compiler that use RB parser nodes.
>>> I guess this is something that is no more relevant with the new Opal compiler ?
>>>
>>
>> Yes, this is the PetitParser based Smalltalk parser that created RB ParseNodes.
>>
>> Opal has a pluggable architecture for the parser, right now it just uses the hand-written
>> RB Parser that came with the refactoring browser.
>
>
> Ok, thank you for the explanation, Markus.
> I'm able to parse Smalltalk code containing QuasiQuote and generate an
> RB parsenodes AST.
> How I can plug my AST tree to generate IR and bytecodes ?

You can just as it to generate a CompileMethod with #compiledMethod

(if you access e.g. ivars and the method was not compiled for a specific
class yet, you might need to #doSemanticAnalysisIn: before)

        Marcus



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev