News for hackers. Stuff that matters.
Re:How to Use the Foreign Function API in Java 22 to Call C ... by yw3410 on Wednesday May 08, 2024 @07:40PM (#40303831)
You can't be as aggressive at removing functions in Java than in Rust though since it's dynamic dispatch (e.g., if you use toString once in your code, you need to keep all implementations of toString which are reachable even if users don't use reflection).
Re:How to Use the Foreign Function API in Java 22 to Call C ... by neonsunset on Thursday May 09, 2024 @05:05AM (#40306446)
.NET's trimmer/linker deals with this quite well, only referenced or otherwise observable .ToString() implementations are rooted.

Without it 1.6-2MiB-sized AOT binaries would not have been possible (most space is occupied by standard library/runtime bits and GC)

Re:How to Use the Foreign Function API in Java 22 to Call C ... by pjmlp on Thursday May 09, 2024 @07:20AM (#40307025)
Except that is what jlinker, and GraalVM/OpenJ9 (among other AOT toolchains) do in practice.