Need help?
<- Back

Comments (59)

  • nmehner
    My problem with AOP has always been that it makes the simple case trivial and the hard case much harder.Looking at transactions: The 99% solution is trivial: Every service call is a transaction. AOP can save me a few lines for every method and things look much cleaner.But then comes the huge excel upload that is performance critical. Batch more service calls to fetch additional information in the background, commit every so-and-so records in a loop depending on the data size, do a custom roll-back if things fail.And suddenly this whole separation of concerns breaks down and creates a huge mess.The simple case saves a few minutes, the complicated case causes weeks of depression. Not a good tradeoff from my experience.An LLM adding to the confusion by only sometimes getting things right and explaining that the separate documents are always valid, except when they are not, well, sounds like a fun experience.
  • guybedo
    AOP is an interesting pattern but i've mostly tried to stay away from it mostly because:- code readability and maintainability takes a hit. If you don't know things are defined using AOP in files x,y,z you can read the code and miss a whole lot of things.- AOP implemented at runtime is a mess when you're trying to debug thingsSo yeah, instead of having aop defined somewhere else to wrap a function call, i tend to prefer doing it explicitly transaction(function())
  • quatonion
    I did a lot of work on intentional programming at Microsoft back in the 90s on C++, and also intentional software later.Our approach was quite a bit different to Kiczales at the time. We had "attribute providers" which were essentially compiler plugin DLLs.These plugins could register themselves at various parse points and add work like enzymes on the AST.So here we have a compile time attribute that writes all the boilerplate to add windowing support to a class. Adding message maps, hooking up the dispatch, life cycle etc.[Window] class MyWindow { };It worked, but as others pointed out, it suffers from combinatorial explosion, and issues with debug ability.That said, as long as you stick within well defined verticals it was still very useful and saved a lot of typing, and reduced cognitive load.I have thought quite a lot about modern versions of this using LLMs and I can see why the article notices a parallel to prompts or spec based designs.At some point I tried to make a version of the system we built almost 30 years ago, but using an LLM as the preprocessor instead of rigid AST hackery.It works a lot better, and you can approach a more continuous interpolations between intent blocks and generated code. Even the combinatorial problem largely disappears.I stopped working on it though because I couldn't really see anyone wanting to adopt a new language or some whacked out extensions these days.Maybe it does have its place though in certain fields. It might be worth having another go at it with fresh hindsight.
  • kstenerud
    > And the "weaver", to use the AOP term, is simply the LLM that generates the program from the documents.Oh HELL NO.The LAST thing you want is a non-deterministic process monkey patching your code.
  • jerf
    I think there's a core of a good idea here, but as others have pointed out, letting the LLM be your "weaver" is going to be very tricky.It's possible that what you have here is an idea for what I consider to be eventually very likely, which is a computer languages still built for humans to be able to understand and debug it, but more primarily for LLMs to write it. Write a language designed to be an aspect-oriented language from the beginning. Equip it with the ability to run something like a language server and point it at a system and get all the "aspects" running and you might have something.But I'm skeptical of bodging this on to an existing language.One of the reasons I suggest making it a new language is that AOP was hampered by being able to use only what languages already supported. The need for a "weaver" is a smell anyhow. Something where the aspect code is the native representation and the "weaving" simply dissolves into the compilation process would not only make the whole thing more appealing in general, I think it would also allow for some things that even code generation might have found a challenge, like aspects that can maintain guarantees because the whole process is more aspect-aware and not broken by the embedded "payload" code written by a human.
  • amarant
    Regarding Thomas first complaint about current implementations being runtime pattern matching, micronauts implementation of AOP is entirely compile time pattern matching.It's really neat:https://micronaut.io/2019/10/07/micronaut-aop-awesome-flexib...
  • mncharity
    Consider "spec -> plan -> implement" as an unremarkable agentic workflow. TFA suggests that Spec be organized by cross-cutting concerns. This seems a nice thought.Doubts in comments so far seem around expectations of an AOP-like experience. Mainly that patching aspects/Spec makes happy changes to implementation. I'm not sure TFA intended that use. Nor that current AOP implementations provide the happy. But lets explore.With a frontier model, a greenfield ends up with, say, some spec and plan docs, and a "woven" implementation. It's reasonable to wonder how well an LLM will then un-and-re-weave code as it makes changes. And how to express join points or equivalent. And how well code review agents will detect/check intended joins continuing to be woven correctly. And whether a baseline of the LLM simply using existing AOP tooling constitutes progress.Coming from non-frontier models, some of that seems more straightforward. Harnesses use lots of small jobs/tasks, with subagent paperwork and reviews. Historically scarce context, precious context, encouraged tightly optimizing single-task context for each job. Including derived code "views", rather than raw code. And associated LLM-coded tooling around working with not-the-raw-code.Thus working with name/signature pseudocode outlines. And filtering code/ast. Both get you closer to having unwoven forms, and to deterministic tooling for un/re-weaving. Consider i18n clutter - just to coddle the model, one might strip it (replace it with English), let the model work, and then restore it. Which is equivalent to un/reweaving an i18n aspect. And even read-only views, like function distillations which drop or abstract some specified variables and associated code, make that "check spec against implementation" code review easier. So, even interpreting TFA broadly, it seems at least potentially possible, no?Big picture, I'd like to get away from traditional "repo as single point in design space, laboriously nudged around", to something which preserves the multiplicity of model/run/prompt ensembles, and allows playing on design space manifolds. "This exact code has been in prod" is useful information, if underutilized, but not so useful as to be worth discarding so many new possibilities.
  • w10-1
    The idea of this post - to write separate requirements for each concern and let LLM's integrate them - is much closer to the Leo version of literate programming, which allowed documents to be composed (roughly via scatter/gather operations mediated by sentinels).But the post entirely lacks the motivation for the AspectJ/AOP join point model: to have principled time/place for concern integration that was statically determined, type-safe, understandable to users -- and suitable for integration.> I've also always hated the specific mechanism that AOP chose to implement it with – something called the "join point model" which basically amounts to runtime pattern matching on a program's call stack and running some code every time a pattern matches.AspectJ's join point model is only dynamic where Java as a reference-based language could not support the static analysis. At compile-time, the "static shadow" of the pointcuts was calculated and implemented where staticly determinable; only the dynamic residue is deferred to runtime (e.g., is the caller to this method of type X?).Many of AspectJ's join points and type extensions - method call or execution, exception throwing, field access - largely have been adopted in many languages (python context managers, swift getter/setters/extensions), and the residue are a bit hard to use.But nothing really matches the power of pointcuts: to combine these predicates and the type-safe state-management - e.g., "when throwing an exception after a transaction, capture the span id along with the user id into a log message"AOP was great for the 7% of code that it was intended for, but was largely displaced as too complicated. Now with LLM's it's a decent hypothesis that with proper training LLM's could actually handle the more complicated but ultimately cleaner programming model - cleaner because it avoids the scattering of similar code which makes it hard to change.The key insight is that dominant concerns establish the basic structure of the application, leaving some important but residual aspects to fit themselves to the structure. That means the dominant structure must be suitable for the AOP integration (i.e., support the right pointcuts and type extensions); solve that and you've solved most integration issues. It's especially helpful for feature architectures, where you offer code in open-source to gain API adoption, paid for by closed-source library integrations with additional features.
  • nh23423fefe
    Has anyone done AOP outside of Spring Framework? That's my only exposure and it feels very library level. Nothing I would use as a the primary way to structure the code.
  • 6gvONxR4sf7o
    One piece of this that could be really nice in a normal language is if an LLM could generate a decent syntax highlighter or code-folding-spec or something for each "aspect." The idea of tooling to help us focus on one piece at a time is great, regardless of AOP.
  • twoodfin
    Putting aside the question of whether AOP is a good model for software systems development, I wonder if the specific approach proposed is a good model for LLM-driven software systems development.LLMs really like the most important context to be clustered in the most recent section of their window. Dividing up cross-cutting concerns into their own documents would seem to be pushing in the other direction.
  • tanepiper
    Hadn't heard of AOP before, but funnily enough for a couple of years now I've been calling working with LLMs "aspective coding" - closer to switching context on different features. Will read up a bit more on AOP as it seems like the prior art on this way of thinking.
  • azkalam
    Effect Systems are the answer to cross-cutting concerns in 2026.
  • whartung
    I appreciate the potential power of AOP, but I'm grateful I never had to use it directly.Rather, I got to rely on the special handling within, notably at the time, the Java JEE ecosystem. It was not "generic" AOP by any means, it was specialized. But I can say that what they did support was more than enough for my applications. I never felt I could use a more flexible framework.I know some folks that did, the embraced it whole hog, and really got some power out of it. AOP could be used to make some very powerful constructs, especially adding dynamic behaviors to existing systems.But that was simply never something I really needed in my Java work.
  • pjmlp
    It never went away on Java and .NET worlds.Also one would say monkey patching on Python and Ruby frameworks is another way to do AOP.
  • lmeyerov
    AOP is a big influence for how we are designing hooks, including custom ones, for louie.ai's agent harness. More principled structure to what is already expected.I'm unclear on AOP in general, esp as proposed here. That's a bigger leap...
  • anon
    undefined
  • HelloNurse
    Is this a joke? Instead of using a formal aspect specification that people (and bots) can get wrong, like any other programming language, trust a bot to do the right thing spontaneously and implement an aspect oriented architecture without tools?
  • taco_emoji
    yeah let's let the randomized sentence vomiter generate code at consistent join points
  • orphereus
    This is overly optimistic to say the least.
  • jdw64
    After reading this post, I got curious and went back to read the original AOP paper. What the OP argued feels like just top-down design. These days, the term 'SPEC-driven' is trending, but it seems like just another word for top-down. They're probably just rebranding it because top-down has a negative image.Originally, AOP was about separating cross-cutting concerns by centralizing them in one place. It used weaving to separate infrastructure code, and implicitness was inherent in that approach. But the books I read back then said this led to 'ghost code.' It inevitably introduced unpredictability because the behavior wasn't visible in the code. And from a programmer's perspective, that becomes a problem when things break.On top of that, while the cross-cutting concerns are centralized, they still end up being tied to the framework's syntax, like Spring AOP's Join Point syntax, so they become dependent on the framework itself.That's why DDD became popular as another way to address OOP's limitations. DDD keeps the business logic pure and framework-agnostic, and that's where things like POJO emerged. At least that's what I read in books, just different approaches to the same problem.AOP was first presented at ECOOP in 1997, and DDD is usually associated with Evans' book. Both are ways of handling OOP's complexity, but the article here doesn't seem to talk about problems with cross-cutting concerns, which is the core of AOP at all. And this is something AI doesn't handle well. AI makes the most mistakes with implicit knowledge.Or maybe I'm wrong because I've been studying programming history through older books and have outdated knowledge. Maybe AOP has evolved since then.What makes it difficult to talk about specific 'oriented' paradigms in programming is that as history moves on and certain problems get solved, if you bring up an older version, you'll get pushback from people who really know their stuff.'That's a problem that was solved 5 to 10 years ago.' 'That issue has evolved and been covered in other books.'So it's hard to talk about any 'oriented' approach because you have to specify which era's version you're referring to. For example, even with OOP, which everyone knows, there's a big difference between Smalltalk, C++, and the modern emphasis on composition over inheritance. Someone might say, 'Modern OOP is centered around composition and value objects — you're behind the times.'AOP might have also evolved and introduced different solutions since then.So while the perspective on a given 'oriented' paradigm does shift over time, it's really hard to have a conversation about programming because it all depends on which era the programmer is from and how far their knowledge goes.That's why lately I've been thinking about problems and the approaches used to solve them, rather than focusing on the 'oriented' labels. I wish someone would write a history book about these paradigms. They'd get a lot of criticism, but for programmers like me, it would be much easier to understand.Sometimes I think it's about time someone wrote a history book on programming
  • dionian
    The stuff i dreamed of doing but was smart enough to avoid in Java many years ago, is what I now use FP to do on the JVM, in scala, without any of the drawbacks of AOP. if i was stuck in java languiage on the jvm for some reason i could see the appeal of trying AOP now that LLM can assist with it. Thinking of the annoying stuff like setting up automated builds/compiler etc
  • rowanG077
    I simply dislike AOP because it makes code much harder to follow. You suddenly have aspects which you need to be aware of at all times, worse aspects can interfere with each other in non-obvious ways. It breaks one of the core aspects of code, that you can do local reasoning.
  • cyberax
    Yea, no. AOP was never worth the trouble.And one giant problem with it is the reliance on global variables. An AOP wrapper has to modify something, and it typically does not have enough access to enough context to do it.So it has to rely on ambient data that has to be saved in a global variable. And this is _bad_. It makes data flow opaque and impossible to follow.And then there are issues with debugging. Where do you put a breakpoint? What happens if you try to step into an instrumented method?PS: yes, a global variable can technically be a thread-local variable. It doesn't matter, it's still a non-local ambient state.
  • 9fry
    [dead]
  • mv_d5339e31
    [dead]