4 ms·
Off topic, but on the question of provenance... Chiba worked with folks at PARC, and this is a year after Gregor Kiczales wrote the book, The Art of the Metaob
by w10-1 3y ago
Off topic, but on the question of provenance...
Chiba worked with folks at PARC, and this is a year after Gregor Kiczales wrote the book, The Art of the Metaobject Protocol. Kiczales designed AspectJ, still in use in Spring today.
The three design dimensions for metaprogramming are static vs dynamic, whole-program vs incremental, and raw vs typed.
AspectJ committed to incremental (and removed whole-program features like callee-side call join points) because Eclipse's incremental compilation made enterprise programming bearable (and of course Java chose it for loading classes).
Staticly, AspectJ did reduce the pointcut shadow at compile-time (unlike (remote) method interception which), but semantically still supported type-safe dynamic checks (mainly instance-of and limited control-flow via a thread-local).
But types were the best part: unlike reflection-based proxies in Java (that formed the basis for most of the EJB/Web containers), AspectJ advice could be written to expose only the required context, and only in a type-safe manner. Inter-type declarations were guaranteed valid at compile-time (and supported default methods 20 years before Java did). And most importantly, the code with aspects was binary- and source-compatible with any code using the unmodified code.
(Of course, it also helped that Java supported debugging from extrinsic source files for JSP's, so you could step into aspects as you like.)
AspectJ static and incremental made it usable, but typed made it safe and correct and understandable.
(And btw, Kiczales dropped out of MIT.)
- pjmlp 3y agoAnd now C# 12 is introducing something similar via interceptors, however its quite clunky versus somethig like PostSharp.