http://www.erights.org/elang/quasi/overview.html
Provides very  good background for quasi-liberals.

As to macros I would posit that you have been using them in Smalltalk80 all
along without the benefit of having the capability for yourself.  There are
a classic set of selectors that get special processing by the compiler.
"to: do:" is an example of one. It gets turned into a while loop by AST
transformation. These special selectors that are really macros are known to
the compiler in a special table. A proper macro system opens the capability
up everyone.

 As to 30 years without noticing that they were needed, I would say they
are long over due. I needed them back in 1997 when Adele Goldberg and I had
a company called Neometron. We used them for for a large system that had
thousands of templates that had escapes to code (both Smalltalk80 and SQL)
embedded within. We did not want string concatenation style coding with
errors only found at run time. By having a Smalltalk80 with macros and
quasi-literal little languages we compiled method by method in the browser
as usual but all the errors in template or sql syntax were found at compile
time. The compile time processing also allowed for an order of magnitude
performance increase because there was a lot of evaluation done in advance.
By doing the work properly in the parser and compiler and making sure code
transformations tracked source code offsets proper single stepping in the
debugger was preserved.  Of course if aggressive rewriting was done you
sometimes have to debug in the expansion but code can be emitted that can
often help a macro aware debugger.

Sadly, I was unable to convince Eliot and Steve Dahl to incorporate the
work into Visualworks 20 years ago. Also sadly, I don't spend a lot of
effort arguing with people that don't understand the need for some
technology I see as useful. :-)

For more examples I suggest taking a look at 60 years of Lisp. Stochastic
sampeling of the corpus should be revealing.  :-)

Simple quasi-literally are relatively easy. A real macro system takes
careful design that leads to compiler plugins that can go way beyond macros
and open up a world of designer application dependent optimizations.



On Tue, Feb 28, 2017 at 10:47 AM stepharong <stephar...@free.fr> wrote:

> Hi david
>
> What you describe is a bit scary.
> Because this is just changing the syntax but it is probably also breaking
> refactorings and probably
> other.
>
> May I ask why would we need macros since after more than 30 years nobody
> really need them.
>
> So do you have good motivating cases for
>         quasi quotes
>         Opal supports compile time evaluation.
> Stef
>
> >  The ES6 design is sound and if you are in a hurry to get the capability
> > it
> > is a great way to go. Once you start using it and get a taste for
> > quasi-literal little languages you will find that you want more.
> >
> > Having a quasi-literal that let's you name the little language to parse
> > you
> > open a very interesting door. After the dust settles you need a parser
> > and
> > compiler framework that allows plugins at every stage.  You "MUST" have a
> > rich and stable AST and it must be usable as a quasi-literal because
> > transpilers abound. You wind up with transpiler code that is templated
> > and
> > quite "Lispy".
> >
> > At the end of the day you will finally let in Macros. I believe thatJulia
> > got all this right. They stick a "@" in front of their macro invocations
> > so
> > you get rid of a lot of confusion. David Moon made the Julia macro
> > system a
> > thing of true beauty. Perfection actually.
> >
> > At the end of the day you want Smalltalk Compile Time "Staged Meta
> > Evaluation".
> >
> > Still, at a minimum go with the ES6 design. Consider "<|" because " ` "
> > is
> > hard to see.  Some fonts do a terrible job with it.  You could do both.
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://forum.world.st/Re-vwnc-Does-anyone-have-a-new-string-literal-tp4667088p4936429.html
> > Sent from the Pharo Smalltalk Developers mailing list archive at
> > Nabble.com.
> >
>
>
> --
> Using Opera's mail client: http://www.opera.com/mail/
>

Reply via email to