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>*
------------------------------------------------------------------------
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 :-).
> *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>*
I'll wait and see on this one.
> 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>*
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).
> 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>*
We'll definitely add better line number reporting.
> 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>*
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
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
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
pir_output_is( <<'CODE', <<'OUTPUT', 'description' );
.sub 'main' :main
say 'ok 1'
.end
CODE
ok 1
OUTPUT
~jerry
You really need to get allison's feedback before rejecting this ticket.
Regards.
--
Will "Coke" Coleda
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