On compiler architecture

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

On compiler architecture

Herby Vojčík
In response to not-so-optimized code actual compiler produces, I began
to write down ideas of the intermediate compiler I produced some year
ago here: https://gist.github.com/herby/7266982 (and which was used as
starting idea for the actual one).

It contains more dynamic aliasing system than the actual one, but alas I
have only been able to write down the first boring part at the moment.
The interesting part with early commits (see into it to know what it
mean in this context :-) ) will appear later (hopefully tomorrow).

I will be glad if you looked at it and found bugs or comment the ideas
or possibility to use to enhance existing compiler. Thanks.

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: On compiler architecture

Hannes Hirzel
Thank you, Herby for posting the reference to your writeup a year ago
https://gist.github.com/herby/7266982

You mention three compilers just under the heading '


I assume you mean

1)  The original (0.9.1) Amber compiler was written around the
metaphor of “everything is an expression”.

2) The compiler in version 0.12 (= the current one) 'new multilayer
OPAL-structured compiler '


3) A proposal for a next compiler
'‘everything-is-a-postponed-assignment’ (eiapa)'


Is this correct?

--Hannes

On 11/1/13, Herby Vojčík <[hidden email]> wrote:

> In response to not-so-optimized code actual compiler produces, I began
> to write down ideas of the intermediate compiler I produced some year
> ago here: https://gist.github.com/herby/7266982 (and which was used as
> starting idea for the actual one).
>
> It contains more dynamic aliasing system than the actual one, but alas I
> have only been able to write down the first boring part at the moment.
> The interesting part with early commits (see into it to know what it
> mean in this context :-) ) will appear later (hopefully tomorrow).
>
> I will be glad if you looked at it and found bugs or comment the ideas
> or possibility to use to enhance existing compiler. Thanks.
>
> Herby
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: On compiler architecture

Hannes Hirzel
P.S.
Ref: 'The common starting point'
All three compilers have identical starting point – both consume the
output of the parser, which is the AST tree composed of `Node` and its
subclasses. The parser itself is based on pegjs ...

On 11/2/13, H. Hirzel <[hidden email]> wrote:

> Thank you, Herby for posting the reference to your writeup a year ago
> https://gist.github.com/herby/7266982
>
> You mention three compilers just under the heading '
>
>
> I assume you mean
>
> 1)  The original (0.9.1) Amber compiler was written around the
> metaphor of “everything is an expression”.
>
> 2) The compiler in version 0.12 (= the current one) 'new multilayer
> OPAL-structured compiler '
>
>
> 3) A proposal for a next compiler
> '‘everything-is-a-postponed-assignment’ (eiapa)'
>
>
> Is this correct?
>
> --Hannes
>
> On 11/1/13, Herby Vojčík <[hidden email]> wrote:
>> In response to not-so-optimized code actual compiler produces, I began
>> to write down ideas of the intermediate compiler I produced some year
>> ago here: https://gist.github.com/herby/7266982 (and which was used as
>> starting idea for the actual one).
>>
>> It contains more dynamic aliasing system than the actual one, but alas I
>> have only been able to write down the first boring part at the moment.
>> The interesting part with early commits (see into it to know what it
>> mean in this context :-) ) will appear later (hopefully tomorrow).
>>
>> I will be glad if you looked at it and found bugs or comment the ideas
>> or possibility to use to enhance existing compiler. Thanks.
>>
>> Herby
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "amber-lang" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [hidden email].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: On compiler architecture

Herby Vojčík
In reply to this post by Hannes Hirzel


H. Hirzel wrote:

> Thank you, Herby for posting the reference to your writeup a year ago
> https://gist.github.com/herby/7266982
>
> You mention three compilers just under the heading '
>
>
> I assume you mean
>
> 1)  The original (0.9.1) Amber compiler was written around the
> metaphor of “everything is an expression”.
>
> 2) The compiler in version 0.12 (= the current one) 'new multilayer
> OPAL-structured compiler '
>
>
> 3) A proposal for a next compiler
> '‘everything-is-a-postponed-assignment’ (eiapa)'
>
>
> Is this correct?

Well, in a sort; in fact I believe the current one is fine except too
static aliasing logic, so it can be inspired by more late-bound aliasing
and on-demand burst output via commits, otherwise, it bring lot of good
things there (semantic analyzer; instructions phase; JS-specific output
stream).

> --Hannes

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: On compiler architecture

Clément Béra
Hey,

just wondering, with the JS specific output stream of the current compiler, if you would want to implement a dart backend for Amber, would it be possible to only add an extra IRDartTranslator (instead of IRJSTranslator), or would you need to edit the whole compiler ?


2013/11/2 Herby Vojčík <[hidden email]>


H. Hirzel wrote:
Thank you, Herby for posting the reference to your writeup a year ago
https://gist.github.com/herby/7266982

You mention three compilers just under the heading '


I assume you mean

1)  The original (0.9.1) Amber compiler was written around the
metaphor of “everything is an expression”.

2) The compiler in version 0.12 (= the current one) 'new multilayer
OPAL-structured compiler '


3) A proposal for a next compiler
'‘everything-is-a-postponed-assignment’ (eiapa)'


Is this correct?

Well, in a sort; in fact I believe the current one is fine except too static aliasing logic, so it can be inspired by more late-bound aliasing and on-demand burst output via commits, otherwise, it bring lot of good things there (semantic analyzer; instructions phase; JS-specific output stream).

--Hannes

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: On compiler architecture

Hannes Hirzel
Herby,

may I ask you how the tables with the example translation have to be read?

1st column = part of the AST
2nd column = ?
3rd column = generated JavaScript code?

--Hannes

On 11/2/13, Clément Bera <[hidden email]> wrote:

> Hey,
>
> just wondering, with the JS specific output stream of the current compiler,
> if you would want to implement a dart backend for Amber, would it be
> possible to only add an extra IRDartTranslator (instead of IRJSTranslator),
> or would you need to edit the whole compiler ?
>
>
> 2013/11/2 Herby Vojčík <[hidden email]>
>
>>
>>
>> H. Hirzel wrote:
>>
>>> Thank you, Herby for posting the reference to your writeup a year ago
>>> https://gist.github.com/herby/7266982
>>>
>>> You mention three compilers just under the heading '
>>>
>>>
>>> I assume you mean
>>>
>>> 1)  The original (0.9.1) Amber compiler was written around the
>>> metaphor of “everything is an expression”.
>>>
>>> 2) The compiler in version 0.12 (= the current one) 'new multilayer
>>> OPAL-structured compiler '
>>>
>>>
>>> 3) A proposal for a next compiler
>>> '‘everything-is-a-postponed-assignment’ (eiapa)'
>>>
>>>
>>> Is this correct?
>>>
>>
>> Well, in a sort; in fact I believe the current one is fine except too
>> static aliasing logic, so it can be inspired by more late-bound aliasing
>> and on-demand burst output via commits, otherwise, it bring lot of good
>> things there (semantic analyzer; instructions phase; JS-specific output
>> stream).
>>
>>  --Hannes
>>>
>>
>> Herby
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "amber-lang" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [hidden email].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: On compiler architecture

Herby Vojčík


H. Hirzel wrote:
> Herby,
>
> may I ask you how the tables with the example translation have to be read?
>
> 1st column = part of the AST
For now, it was always complete AST (sans unnecessary attributes of nodes)
> 2nd column = ?
The inner workings of the eiapa compiler
> 3rd column = generated JavaScript code?
Generated output. Maybe in multilayer compiler it will be instructions in intermediate representation, but showing the final JS code is what shows what is actually generated from it at the end (the 'flat' compiler generated the code directly).

> --Hannes

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: On compiler architecture

Herby Vojčík
In reply to this post by Herby Vojčík


Herby Vojčík wrote:
> It contains more dynamic aliasing system than the actual one, but alas I
> have only been able to write down the first boring part at the moment.
> The interesting part with early commits (see into it to know what it
> mean in this context :-) ) will appear later (hopefully tomorrow).

It is not as fast as it can be, but I got a few steps forward, and it
already contains one tricky code example. You can see how it works with
more complex examples and see it's advantages.

What's more, during writing it and playing with current compiler, I
found two bugs of the current compiler, one crash during compiling, one
producing incorrect code.

Herby

P.S.: I hope there will not be any more bugs, I would get scared.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: On compiler architecture

Hannes Hirzel
On 11/2/13, Herby Vojčík <[hidden email]> wrote:

>
>
> Herby Vojčík wrote:
>> It contains more dynamic aliasing system than the actual one, but alas I
>> have only been able to write down the first boring part at the moment.
>> The interesting part with early commits (see into it to know what it
>> mean in this context :-) ) will appear later (hopefully tomorrow).
>
> It is not as fast as it can be, but I got a few steps forward, and it
> already contains one tricky code example. You can see how it works with
> more complex examples and see it's advantages.
>
> What's more, during writing it and playing with current compiler, I
> found two bugs of the current compiler, one crash during compiling, one
> producing incorrect code.

You mean this one https://github.com/amber-smalltalk/amber/issues/713

which was the other one?

>
> Herby
>
> P.S.: I hope there will not be any more bugs, I would get scared.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: On compiler architecture

Herby Vojčík
H. Hirzel wrote:
> On 11/2/13, Herby Vojčík<[hidden email]>  wrote:
>> What's more, during writing it and playing with current compiler, I
>> found two bugs of the current compiler, one crash during compiling, one
>> producing incorrect code.
>
> You mean this one https://github.com/amber-smalltalk/amber/issues/713
>
> which was the other one?

The other was #712 or #714, but I had older amber and in master in was already fixed.

>> Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.