develooper Front page | perl.perl5.porters | Postings from January 2018

Re: We need a language design process.

Thread Previous | Thread Next
David Nicol
January 7, 2018 22:01
Re: We need a language design process.
Message ID:
came *really* close to providing the proper kind of hook I was looking for,
when my Macrame project encountered the limits of the naive parser in
Filter::Simple. I couldn't quite make sense of the invocation mechanisms

In general, the macro keyword would be sugar for introducing the new
syntax; keeping consistent with the LALR parser makes circumfix macros (for
some reason that seemed like an essential feature) even trickier -- when
the closing token is not found within the compilation unit the tokens need
to get returned to the token stream or the pointer backed up, or something
-- complicated

I don't remember.

It seemed like a possible way forward would be to ditch YACC entirely and
restate the actual language parsing in Perl -- towards this end I did
reverse-engineer some state diagrams -- it seemed like after doing the
extensive research exercise of actually delivering Perl parsed by Perl, the
things that could be simplified into macros might become apparent -- for
instance all the various loops could be formally normalized into c-style
for loops by macros.

On Sun, Jan 7, 2018 at 7:38 AM, Paul "LeoNerd" Evans <
> wrote:

> On Mon, 1 Jan 2018 16:35:30 -0600
> David Nicol <> wrote:
> > I've always held, and continue to hold, that a well-defined macro
> > language would be able to take care of having all the various styles
> > (smartmatch and given/when are for purposes of this argument
> > "styles") co-exist, by declaring a set of transforms that is so be
> > applied to the current compilation unit before it gets instantiated
> > into the executable format it eventually gets instantiated to. So I
> > see macros operating at the same level as the "peephole optimizer."
> Mmmm macros.
> They're on my TODO list sometime after I get async/await nicely working.
> --
> Paul "LeoNerd" Evans
>      |
>  |

“no man should be compelled to do what the laws do not require; nor to
refrain from acts which the laws permit.” Calder v. Bull (U.S. 1798)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About