<div dir="ltr">On Wed, Nov 6, 2013 at 9:34 AM, Chad Joan <span dir="ltr"><<a href="mailto:chadjoan@gmail.com" target="_blank">chadjoan@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wednesday, 6 November 2013 at 08:19:13 UTC, Jacob Carlborg wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 2013-11-05 17:55, Philippe Sigaud wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Walter is far from convinced that AST manipulation is a good thing. You<br>
would have to convince him first. His fear is that it will lead to<br>
unreadable code, and everyone using her own personnal version of D.<br>
AFAICT, nothing of the sort happened in Lisp (I mean, Lispers have<br>
balkanization, but *not* due to AST manipulation).<br>
</blockquote>
<br>
You know, Walter did a talk about AST macros at the first D conference. The idea back then was to add AST macros, hence the "macro" keyword.<br>
</blockquote>
<br></div></div>
Also, IIRC, it is believed that string mixins with CTFE are potentially more powerful.  I am under the assumption that Walter is taking the long view and waiting for the community to furnish their own powerful AST manipulation tools using the existing spec.  I suspect that he is opposed to baking AST manipulation into the /language spec/, but is perfectly accepting of the notion of using AST manipulation to generate code, reduce boilerplate, implement exotic features and DSLs, and so on.  Just don't complicate the core language any more than it already is.  Sorry if I misrepresented you Walter; I can only make educated guesses ;)<br>
</blockquote><div><br></div><div>Well, I remember him saying that he doesn't want everybody and their dog to change the D syntax. If we get macros, that's exactly what we can do. For example, telling the compiler (or another tool), to rewrite</div>
<div><br></div><div>int a := 1;</div><div><br></div><div>into</div><div><br></div><div>immutable a = 1;</div><div><br></div><div>But that means the original not-D code cannot be compiled by anyone with a D compiler anymore (obviously). And soon everybody is transforming the grammar according to what they think is cool.</div>
<div>That's his PoV IIRC.<br></div><div><br></div><div>I'm more interested in getting to ability to define my own lowerings: in the same way that scope statements or foreach over ranges are rewritten into lower-level D code by the comiler, I would like to be able to define my own syntactic constructs.</div>
<div><br></div><div>Plus, everybody here know that AST macros can cure world hunger :) Wouldn't that be nice? </div></div><br></div></div>