3 ms·
> I don’t know if any of these are impossible without runtime metaprogramming, but they all seem like they’d be more difficult. Not really? I mean it is more
by masklinn 4y ago
> I don’t know if any of these are impossible without runtime metaprogramming, but they all seem like they’d be more difficult.
Not really? I mean it is more difficult in that you have to specify all sort of things which are left unsaid in the article's snippet, but fundamentally you just need the ability to define or override the act of "calling" an object, aka
void operator () ()
or
impl FnOnce<...> for <...>
Something not all statically typed languages have, but not all dynamically typed languages either (doesn't exist in javascript for instance, you can staple shit on a function object or extend Function but AFAIK the language has no callability protocol).
> I can imagine all sorts of uses for this kind of trick. Here’s some I’d like to see:
Most (though not all) of these are already better and more generally solved via introspection tooling.
> I guess the closest to the hyperprogramming model is Pharo? The dynamic code inspector is a big deal, plus there’s this fun talk.
The author should take a look at Self. It has similarities with Smalltalk systems, but is an other window into an... interesting world.