Interpolated strings

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 18 23:51:30 PDT 2017


On Wednesday, 19 April 2017 at 03:49:09 UTC, bpr wrote:
> I don't think I've ever heard from Common Lisp, Scheme or 
> Clojure programmers that they'd like to remove macros from 
> their respective languages for the reasons you mention. I don't 
> see the disasters there. The Julia folks looked at the Lisp 
> experience and decided to include macros.

Lisp AST is minimal.

> Both Rust and Nim support macros. Scala too. Not long enough 
> for the disaster yet?

How many Rust programmers write their own macros? My impression 
is that Rust macros is a temporary fix because they don't have 
another meta programming scheme in place. I also believe that 
Rust macros can break between releases.

> last resort. But they're very powerful, and sometimes I'm not 
> smart enough to figure out how to do what I want cleanly with 
> less powerful features.

Like what?

Certainly, term-rewrite-languages are powerful, e.g. the language 
Pure:
https://en.wikipedia.org/wiki/Pure_(programming_language)

But I don't quite see it as an important feature for an 
imperative language with an AST as complex as D and with rather 
non-uniform semantics.

If you want AST-macros in D you should also argue for redefining 
the core language, and turn everything that is unnecessary and 
that can be done as lowering into macros (e.g. "for each").



More information about the Digitalmars-d mailing list