Comments (5)
Hei Sirinath,
I am glad you like Byte Buddy. I tested the API with both Scala and Groovy which are the two JVM languages that I occasunally use and those work just fine and especially in Scala, the DSL is very nice to read when ommitting dots and paranteses. And especially when using the more low-level APIs, it is not an accident that many methods of the functional interfaces in use are named apply
.
Did you think about some specific language which would require improved support? If you have a language you would like to support, pull requests are very welcome!
Or did you speak about support for manipulating code written in other languages? In this case, Byte Buddy works with byte code which is language agnostic. With for example Scala, Byte Buddy behaves the same way as Java reflection does. As Byte Buddy ignores synthetic memebers in its default configuration, using Byte Buddy with other languages is however quite straight forward most of the time. A lot of code relies on reflection, thus languages often try to expose a Java-compatible interface what of course helps a lot.
All the best, Rafael
from byte-buddy.
Languages like Scala generate different names at the bytecode level. So you have to know exactly what something is complied into. It would be helpful if you can use the language level symbols which translate into the actual name / representation in bytecode. Also this is frequently changing in the case of Scala.
from byte-buddy.
You are right, Scala is a problematic use-case in many relations. I do consider adding more Scala sensitive matchers at some point, the problem is however that these matchers would need to relate to a specific version of Scala as changes in the language would of course also affect the provided matchers.
I hope that I will find the time at some point to better analyze what changes are custom and to provide matchers that are least likely to fail. Up till now it is more or less the responsibility of the user to provide appropriate matchers or to, for example, only intercept methods on annotations instead of naming patterns when working with Scala.
from byte-buddy.
May be you can have a configuration file which match the Scala name with representation for the given version but transparent to the user. One this is defined user for the given version the user do not have to worry about what bytecode is generated underneath.
from byte-buddy.
I thought about this and I came to the conclusion that this should not be a part of the core library but should rather be covered by an external library. The future of languages like Scala is uncertain and there are no guareantees about how their compilation is handled in the future.
If I added this fearure, I wanted to always be in sync with the compiler which is something I cannot promise. I therefore recommend Scala developers to use more explicit marks such as annotatations when identifying methods.
from byte-buddy.
Related Issues (20)
- seems that namedOneOf isn't working as expected HOT 1
- Release missing of version 1.14.15 HOT 1
- java.lang.NoSuchMethodError when using the agent for method instrumentation HOT 2
- Cannot invoke public constructor HOT 5
- ByteBuddyAgent, Java 21 - A Java agent has been loaded dynamically HOT 2
- include method does not exist for Method Delegation approach HOT 6
- Having trouble delegating added instance method to static method HOT 2
- Setting value in constructor aliases collections HOT 5
- Is it possible to lazily instantiate AllArguments?
- install transformer takes too long time HOT 3
- Example that could be used in documentation HOT 6
- Issues attaching to Solaris Hotspot on Solaris 10 and 11. HOT 1
- How to generate multi-level generic code ? HOT 2
- java.lang.IllegalAccessError HOT 15
- InjectionStrategy.UsingUnsafe.OfFactory HOT 1
- java.lang.IncompatibleClassChangeError: Interface method reference: java.util.stream.Sink.begin(J)V HOT 1
- defineField not working well HOT 1
- JDK class enhancements HOT 3
- ByteBuddy is incompatible with CDS due to the Java 6 baseline HOT 4
- No JPMS module-info or Automatic-Module-Name in byte-buddy-dep HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from byte-buddy.