3 ms·
Javascript annotations are finally landing & they are very much enabling aop like concerns. Alas none of thr original greatness of javascript has been allowed.
by rektide 3y ago
Javascript annotations are finally landing & they are very much enabling aop like concerns.
Alas none of thr original greatness of javascript has been allowed. The new language features are all 100% special snowflake things, miles apart from the everything-is-an-object world we had. So these annotations/transforms are load-time only. They make a bunch of changes to your classes or whatever as the class loads then they are erased, invisible, totally unable to be seen unless explicitly coded.
Dripping disdain for this weak ass shitty path JS has started following. We keep making invisible unreflective shit & it's all super shit. Private fields can't be reflected on at all. ESM took over half a decade to get any kind of module metadata like import.meta and there is absolutely positively none of the module registry notions we were talking up as ESM was being crafted.
Everything is a huge downgrade for a runtime where you can look around & see what you have. To me, the neat spirit of AOP is when you not just attach some static annotations & compile it away, but when the runtime can keep growing new ways to be self aware. When you can keep compounding & meta-mutating. But the language design keeps shoving us down narrower more limited paths where the runtime actively tries to blind itself. There's such a huge massive narrative here on language design, & it should be in textbooks & screamed out loud, but it's invisible & unseen & the forces of conservative secure encapsulation & hiding are the only ones with any power or say & everyone else is losing. We have AOP about to happen but it's sad AOP, ignorant AOP, blind AOP.
Dynamic runtime AOP is just one of many capabilities - like DI/dependency Injection - where really what we are doing is creating a powerful metaplatform for resources, for object instances (and factories). Having management over objects is intensely interesting & empowering. Declarative code is just a cheap way to explicitly wire up resources/instances, with no management layer. I loved & hope we get back to more interesting & ambitious times when object repositories become powerful interesting object generating & manipulating entities.