Mixin is a trait/mixin and bytecode weaving framework for Java using ASM

  • For an example of how this is used when setup: https://wiki.fabricmc.net/tutorial:mixin_examples

  • > ASM is an all purpose Java bytecode manipulation and analysis framework.

    Oh. I was expecting something much more weird from the title, and that's a pretty confusing/misleading name for that.

  • I was curious about this as perhaps a new approach to recipe-oriented bytecode injection. But the I looked at the project's (long) history and docs status. It seems that the main contributor has tapered off this project over time, and more specifically hasn't been active since July. (Mumfrey, if you're out there, please tell us what's up)

    So, OP, what made you mention this here now?

  • I kind of wish Java just went full Objective-C and provided native APIs to patch and redirect methods. Having everyone ship a bytecode manipulation library just to mock a method or two is quite annoying given how easy it would be for the runtime to offer this directly (and probably more performantly).

  • What is the advantage compared to established AOP libraries, such as AspectJ or BytecodeBuddy?

  • Isn't composition is superior to mixins for a few reasons, particularly the "Single-responsibility principle" ?

  • ? alt: Java 23 - Class-File API (Second Preview)

    https://news.ycombinator.com/item?id=41567720

  • ah yes ASM, the bytecode manipulator for java. Please look forward to JAVA, my upcoming tool for manipulating assembly code.