Let me add some more motivation and background for the discussion. I
responded to [email protected] questions by mail yesterday but it didn't
wind up on the forum.  Sorry about that.

http://www.erights.org/elang/quasi/overview.html
Provides very good background for quasi-liberals. I believe this work lead
to the ES6 solution by way of Mark Miller.

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 macros 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 in a template language which had escapes Smalltalk80
code embedded within. Also embedded within the tempting code and Smalltalk
code was SQL code.  This was allowed to be recursive so it was a little
language free for all. 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 and our non programmer users continued to
compile method by method in the browser as usual but all the errors in
template or sql syntax were found at compile time. There were no external
files and everything continued to work with Change Sets and Change List
technology that allowed recovering after a crash. The compile time
processing by way of compiler staging plugins also allowed for an order of
magnitude performance increase because there was a lot of evaluations that
could be 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 really
aggressive rewriting was done you would sometimes have to debug in the
expansion but we emitted code to help the debugger with macros  and custom
optimizations. The need to debug some macros in the expansion is a very old
unsolved problem.

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. I have continually had to wait years before the time was right.
:-)

I know this will sound a bit "Snarky" but for more examples I suggest taking
a look at 60 years of Lisp. Stochastic sampeling of the corpus should be
revealing. :-)

And now for a appeal to authority, 

"Lisp isn't a language, it's a building material."

- Alan Kay


and in conclusion:

Simple quasi-literally are relatively easy and can be done with out being
too disruptive. A real macro system takes very careful design that leads to
compiler plugins that can go way beyond macros and open up a world compile
time meta programming and the wonderful world of application dependent
optimizations.

cheers,
-David (voice from the distant past) Leibs



--
View this message in context: 
http://forum.world.st/Re-vwnc-Does-anyone-have-a-new-string-literal-tp4667088p4936696.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.

Reply via email to