Skip to content

Conversation

@andreaTP
Copy link
Collaborator

This is a breaking change of the code generated by the WasmModuleInterface annotation.

Also fixes: #725

Currently WasmModuleInterface generates for the Wasm Module "Export" section a Java interface, this is sub-optimal as we cannot "cache" the direct exports on the module and we have to go, every time, through a Map<String, ..> lookup.

With this change we propose to generate a full fledged class that can be instantiated based on a runtime.Instance and will keep highly optimized and Java idiomatic accesses to the exports.

To review this change I'd encourage reviewers to look at the folders host-module/it/target/it/**/target/generated-test-sources/test-annotations before and after the change.

The new encoding is much closer to what has been done manually for real-world integrations in SQLite4j and proxy-wasm-java-host (cc. @chirino).

As a demo I also applied the proposed changes to Prism and it seems to be a step in the right direction.

@andreaTP andreaTP merged commit 04426f0 into dylibso:main Mar 27, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WasmModuleInterface colliding method names

2 participants