
Refactoring Towards Language - mpweiher
https://blog.metaobject.com/2018/11/refactoring-towards-language.html
======
mncharity
> How can we [...]

One thought-provoking prompt (from a bar conversation at SPLASH last week) is
"with a sufficiently powerful __editor__ we could ..." It seemed a form of
"what does a collaborative compilation environment look like... with an
editor-like ui?" Here, it suggests reversible metaprogramming as presentation.
You open your generic ObjC file, and your editor improves readability - by
colorizing syntax, and collapsing hierarchy to outline, and... performing the
code transformations described to hide boilerplate.

------
saagarjha
> As is typical when you remove duplication, you notice more duplication,
> because stuff is closer together: the two parameters are almost identical,
> except for capitalisation. This doesn't have to be the case, but it is a
> good convention to have. Alas, the pre-processor can’t change the
> capitalisation of strings so we are stuck.

If you're at the point where you're using the processor, a bit of runtime
trickery might be useful as well; specifically,
NSSelectorFromString([CFSTR(commonName ":") lowercaseString]). You get an
extra method call at runtime, but honestly, what's an extra couple
nanoseconds?

~~~
_asummers
Losing tbe ability to grep for usage, for one. And creating another
abstraction simply to save typing. I’ve done similar things in thr past and
have regretted it every single time. Just be explicit, it will be okay.

~~~
saagarjha
> Losing tbe ability to grep for usage, for one.

Grep for what? You should still see the outer macro; this just saves you from
typing essentially the same parameter twice.

