Byte Buddy
sapling
Our great sponsors
Byte Buddy | sapling | |
---|---|---|
5 | 43 | |
6,012 | 5,808 | |
- | 2.4% | |
9.0 | 10.0 | |
6 days ago | 3 days ago | |
Java | Rust | |
Apache License 2.0 | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Byte Buddy
-
Monkey-patching in Java
As seen above, the API exposes the user to low-level bytecode manipulation via byte arrays. It would be unwieldy to do it directly. Hence, real-life projects rely on bytecode manipulation libraries. ASM has been the traditional library for this, but it seems that Byte Buddy has superseded it. Note that Byte Buddy uses ASM but provides a higher-level abstraction.
-
Any news on the Classfile API?
Just a drive-by comment: ByteBuddy is worth a look https://bytebuddy.net/. It is built on top of ASM.
-
Proposed: A new CMake scripting language usable alongside existing one
> can you show an example of how you'd parse, say, a .java.in
The canonical way to do such a thing is through the java annotation processing api [1] and using a tool like java poet [2]. Before you did that, you'd probably decide if you wanted to instead use bytecode generation with a library like bytebuddy [3]
But, assuming for some reason, you wanted to torture yourself and actually consume a java.in file and apply a regex, then you'd probably pull out the "maven-replacer-plugin" [4] and configure that for the task at hand. (or use your favorite templating language plugin. There's a million of them).
Though, to be fair, this really isn't something that comes up in regular java programming due to the nature of the ecosystem. Anything you'd want to codegen likely already has a library and anything you didn't would receive (legitimate) push back.
[1] https://www.baeldung.com/java-annotation-processing-builder
[2] https://github.com/square/javapoet
[3] https://bytebuddy.net/
[4] https://github.com/beiliubei/maven-replacer-plugin
-
is rust the only language to have procedural macros?
Have a look at byte buddy.
-
Byte Buddy on Android made possible
If you've ever used libraries like https://github.com/JakeWharton/hugo or https://hibernate.org/ (if you've ever done some backend development) and wondered how do they seem to add some code/logic into your app just by adding some annotation to some method, or if you ever wondered how mocking frameworks like Mockito can change a class behavior for example, then most likely you're interested in a programming technique that allows to modify existing code, usually known as Aspect oriented programming (also known in Java as Bytecode instrumentation) which, even though it might sound intimidating at first, some really cool tools such as Byte Buddy or AspectJ make it quite easy to accomplish.
sapling
- Monorepos: Please Don't (2019)
-
Twenty Years Is Nothing
I am personally surprised that TFA didn't mention either jj or Sapling [0] given its emphasis on how both Git and svn were both made to be backwards compatible!
[0] https://github.com/facebook/sapling
-
Jj init – getting serious about replacing Git with Jujutsu
Lots to digest here! I have been keeping an eye on Pijul so it is cool to see some of its features implemented in jj. Sapling[0], similarly, is a new VCS tool out there which can work with a git repo. It also has anonymous branches, no staging area, supports stacked commits and can track the history of a commit over time. I've been using a similar workflow to the article's author: git with a UI to handle commits of hunks of a file to group related changes. My working branch often has unrelated changes that get tossed from branch to branch as I am able to commit. I haven't figured out where these new tools fit into my workflow yet, but I am glad there's new options that will help making working on a project more flexible and organized.
[0]: https://sapling-scm.com
- Sapling – A VCS from Meta
- Sapling: A Scalable, User-Friendly Source Control System
-
Ask HN: Can we do better than Git for version control?
yep both extended it and have versions that can work against GitHub/git servers.
sapling scm from meta has I think the best cli and VS code UX https://sapling-scm.com/
jj from google is also mercurial derived with very similar cli features like histedit and has support for deferring conflict resolution https://github.com/martinvonz/jj
- Your GitHub pull request workflow is slowing you down
- Sapling – A Scalable, User-Friendly Source Control System
- Mononoke
What are some alternatives?
Javassist - Java bytecode engineering toolkit
go-git - A highly extensible Git implementation in pure Go.
Byteman - Byteman Project main repo
nextjs-template - A bit personalized version of the `with-typescript-eslint-jest` template.
easydeviceinfo - :iphone: [Android Library] Get device information in a super easy way.
FTC-for-VS-Code - A VS Code extension for accessing FTC snippets, debugger, and Android cmdline tools from a button
timber - A logger with a small, extensible API which provides utility on top of Android's normal Log class.
buck2-prelude - Prelude for the Buck2 project
joda-time-android - Joda-Time library with Android specialization
reactide - Reactide is the first dedicated IDE for React web application development.
StatusBarUtil - A util for setting status bar style on Android App.
dulwich - Pure-Python Git implementation