Strangely Consistent

Theory, practice, and languages, braided together

Macros progress report: D1 merged

I've merged my first chunk of work, known to the grant application as "D1", into the nom branch of Rakudo. Concretely, this means three things:

The work has progressed nicely so far. It's been a little trickier than I expected, but not insurmountable yet, and I've received plenty of support from jnthn++. The time estimates were way too optimistic, it turned out — partly because the grant took a while to get accepted, partly because $dayjob keeps wanting tuits — but at least I'm not stuck.

One interesting aspect of the grant that I didn't expect is that much of my thinking happens in gists. Increasingly, I'm beginning to see gists as a sort of "semi-private blog posts". They're notes mainly left for myself and my creative process, and they don't clutter up the blog feed, but they're there if people are interested enough to see how sausage is made. I don't go back and "fix" gists when I learn new things that contradict what's in them — I just write new ones.

Here, just for reference, I collect all the gists I've made so far philosophizing on macros:

I have one more gist coming up that I haven't written yet, about how macro-argument AST thingies are thunkish and rebind to their outer context just like closures do.

The other "artifacts" that have fallen out of the grant work so far, are:

Looking ahead a bit, what's up next is D2. Informally, D2 consists of "getting those little {{{$stuff}}} thingies to work". We need a way to represent "there's a placeholder here" in the AST, because that's how the ASTs look during the static part of their lifetime (before macro application). It will require a new AST type. As it happens, PAST in nqp/Rakudo is just about to be replaced by the next generation of AST technology, and jnthn++ is just about to start working on that. So it makes sense for me to assist him, since I'm now blocking on the new AST technology landing in Rakudo for my macros work. Aside from blocking, I expect D2 to be quite easy to implement.

See you again at the next milestone. And possibly at part-way resting stops in between.