Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #40002] TGE Refactor / Compiler Tools Object

5 views
Skip to first unread message

Kevin Tew

unread,
Jul 28, 2006, 11:43:27 AM7/28/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Kevin Tew
# Please include the string: [perl #40002]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40002 >


What bullet items will the TGE refactor consist of?

* better command-line arg processor, like getopts, but returning a capture
* optimization levels based on level, group related optimizations which
may occur during different transform steps
* support for languages other than PIR
* generic PAST/POST nodes for short-circut ands and ors
* basic conditional and case constructs, there exists a common semantic
for if/else, it should be represented in a common way in PAST
* for and while loop generation
* label management.
* scope management.

*38761 <http://rt.perl.org/rt3/Ticket/Display.html?id=38761>* *[TODO]
TGE, precompile more <http://rt.perl.org/rt3/Ticket/Display.html?id=38761>*

wi...@coleda.com
*39831 <http://rt.perl.org/rt3/Ticket/Display.html?id=39831>* *TGE -
Needs more diagnostics on failure.
<http://rt.perl.org/rt3/Ticket/Display.html?id=39831>*

wi...@coleda.com
*39854 <http://rt.perl.org/rt3/Ticket/Display.html?id=39854>* *[PATCH]
adds preamble section to tge grammar to allow for includes and global
defines <http://rt.perl.org/rt3/Ticket/Display.html?id=39854>*

te...@tewk.com
*39897 <http://rt.perl.org/rt3/Ticket/Display.html?id=39897>* *[PATCH]
TGE - add basic syntax error
<http://rt.perl.org/rt3/Ticket/Display.html?id=39897>*

wi...@coleda.com
*39905 <http://rt.perl.org/rt3/Ticket/Display.html?id=39905>* *[TODO]
TGE - line number reporting.
<http://rt.perl.org/rt3/Ticket/Display.html?id=39905>*

wi...@coleda.com
*39913 <http://rt.perl.org/rt3/Ticket/Display.html?id=39913>* *[BUG]
TGE - Can't use } in the transform definitions.
<http://rt.perl.org/rt3/Ticket/Display.html?id=39913>*

wi...@coleda.com

------------------------------------------------------------------------

Patrick R. Michaud

unread,
Aug 3, 2006, 10:48:47 AM8/3/06
to perl6-i...@perl.org
On Fri, Jul 28, 2006 at 08:43:27AM -0700, Kevin Tew wrote:
>
> What bullet items will the TGE refactor consist of?

Keeping in mind that the "TGE refactor" really also includes refactoring
PAST and POST, we have...

> * better command-line arg processor, like getopts, but returning a capture

Yes.

> * optimization levels based on level, group related optimizations which
> may occur during different transform steps

Eventually this will happen, but I don't know if it'll be in the first
round of refactoring.

> * support for languages other than PIR
> * generic PAST/POST nodes for short-circut ands and ors
> * basic conditional and case constructs, there exists a common semantic
> for if/else, it should be represented in a common way in PAST
> * for and while loop generation

Yes, yes, yes, and yes.

> * label management.
> * scope management.

Scope management definitely in this first refactor; label management may
wait slightly (or I'll just invite someone else to do it :-).

I'll wait and see on this one.

Definitely.

> wi...@coleda.com
> *39854 <http://rt.perl.org/rt3/Ticket/Display.html?id=39854>* *[PATCH]
> adds preamble section to tge grammar to allow for includes and global
> defines <http://rt.perl.org/rt3/Ticket/Display.html?id=39854>*

I'm working this one out. There *will* be a way to set pragmas (e.g.,
so that the :language(...) modifier isn't specified on every transform).

We'll definitely add better line number reporting.

In discussions with Allison at OSCON, I noted that we needed to reconsider
the syntax slightly. We don't want TGE to have to know how to parse every
language, and it may not be reasonable to expect every compiler to expose
a parser. So, if we're going to allow other languages in the transform
bodies, we may want a "hereis" or podly {{...}}, {{{...}}} syntax to
delimit the transform bodies. At the moment I'm leaning towards the {{...}}
form, if only because PGE is already using it.

Pm

Kevin Tew

unread,
Aug 3, 2006, 1:21:57 PM8/3/06
to parrotbug...@parrotcode.org, pmic...@pobox.com
Patrick R. Michaud via RT wrote:
>
> In discussions with Allison at OSCON, I noted that we needed to reconsider
> the syntax slightly. We don't want TGE to have to know how to parse every
> language, and it may not be reasonable to expect every compiler to expose
> a parser. So, if we're going to allow other languages in the transform
> bodies, we may want a "hereis" or podly {{...}}, {{{...}}} syntax to
> delimit the transform bodies. At the moment I'm leaning towards the {{...}}
> form, if only because PGE is already using it.
>
> Pm
>
>
How about here doc style?
This was mentioned on IRC by either Coke or Particle, I had the the same
idea.

Allison Randal

unread,
Aug 3, 2006, 1:37:00 PM8/3/06
to Kevin Tew, parrotbug...@parrotcode.org
Kevin Tew wrote:
> Patrick R. Michaud via RT wrote:
>> So, if we're going to allow other languages in the transform
>> bodies, we may want a "hereis" or podly {{...}}, {{{...}}} syntax to
>> delimit the transform bodies. At the moment I'm leaning towards the
>> {{...}} form, if only because PGE is already using it.

I'm comfortable with multiplying curly brackets. We may also ultimately
offer a "shorthand" form something like:

t/<tree pattern to match>/<code to transform tree>/

And allow all the perlish alternate delimiters.

> How about here doc style?
> This was mentioned on IRC by either Coke or Particle, I had the the same
> idea.

We talked about that at OSCON. The problem is that it encourages people
to think of the body of transform rules as strings. They aren't strings,
they're code blocks.

Allison

Patrick R. Michaud

unread,
Aug 3, 2006, 1:38:30 PM8/3/06
to Kevin Tew, parrotbug...@parrotcode.org

Sorry, "heredoc" is what I meant by "hereis" above. But yes, I'm thinking we'll
allow some form of heredoc.

Actually, {{, {{{, {{{{ may end up simply being shortcuts that say "heredoc with }}, }}}, }}}}
as the end marker...".

Pm

Jerry Gay

unread,
Aug 3, 2006, 2:00:43 PM8/3/06
to Allison Randal, Kevin Tew, parrotbug...@parrotcode.org
that may be a perl5 way of looking at it, but having written countless
pir tests with heredoc syntax, i for one am used to thinking of them
as more than just strings. but as long as there's a syntax that works,
i don't really care what it looks like

pir_output_is( <<'CODE', <<'OUTPUT', 'description' );
.sub 'main' :main
say 'ok 1'
.end
CODE
ok 1
OUTPUT

~jerry

Will Coleda

unread,
Jul 20, 2009, 12:17:10 AM7/20/09
to parrotbug...@parrotcode.org, parro...@lists.parrot.org
On Sun, Jul 19, 2009 at 10:50 PM, Christoph Otto via
RT<parrotbug...@parrotcode.org> wrote:
> On Sun Jul 19 16:18:01 2009, jk...@verizon.net wrote:
>> Would any of the participants in this thread be able to post an update?
>>
>> Was the TGE refactor ever done?
>>
>> If not, is it still needed in light of subsequent work on the Parrot
>> Compiler Tools?
>>
>> Thank you very much.
>> kid51
>
> I'm marking this as rejected because (as far as I can tell) TGE has been
> superseded by PCT.  It's only around because Lua and possibly other HLLs
> depend on it.  It's certainly not going to be refactored.
> _______________________________________________
> http://lists.parrot.org/mailman/listinfo/parrot-dev
>

You really need to get allison's feedback before rejecting this ticket.

Regards.


--
Will "Coke" Coleda

Christoph Otto

unread,
Jul 20, 2009, 12:41:26 AM7/20/09
to Will Coleda, parrotbug...@parrotcode.org, parro...@lists.parrot.org

In retrospect, I completely agree. I've sent her a msg via purl. Hopefully
she'll see either this thread or the purl msg and say which direction these
TGE tickets should go. I'll either reopen this ticket or close the others
once I hear from her.

Christoph

0 new messages