Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a compatibility layer for JSR 223 #149

Open
andreaTP opened this issue Jan 12, 2024 · 2 comments
Open

Implement a compatibility layer for JSR 223 #149

andreaTP opened this issue Jan 12, 2024 · 2 comments

Comments

@andreaTP
Copy link
Collaborator

https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/prog_guide/api.html

thomasdarimont added a commit that referenced this issue May 7, 2024
Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
@thomasdarimont
Copy link
Collaborator

Support for JSR 223 sounds interesting!

I wonder how this should work though, given the fact that the Scripting API works mostly with Strings.

How should users provide wasm "scripts"?
Wasm as base64 encoded String, or should we interpret the script as a path to a wasm file?
Should we support .wat?

How should we specify which exported function to call? Should we default to the "start function".

How should we handle parameter bindings, e.g. enforcing their types?

@andreaTP
Copy link
Collaborator Author

andreaTP commented May 8, 2024

Let me share my thoughts on this:

I would take inspiration from the API exposed by GraalVM Polyglot.

How should users provide wasm "scripts"?

byte[] ?

Wasm as base64 encoded String, or should we interpret the script as a path to a wasm file?

Why base64? Do you see any issue with using directly array of bytes?

How should we specify which exported function to call? Should we default to the "start function".

The start function will be invoked on initialization of the Module, we need to be able to extract the exported functions by String name.

How should we handle parameter bindings, e.g. enforcing their types?

We don't have this and the API is still not really stable there, I would leave it fully low level and dynamic at the moment and we will refine/improve at a later stage.

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 a pull request may close this issue.

2 participants