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

Text format support for a Java WebAssembly runtime #224

Open
kanha-gupta opened this issue Feb 4, 2024 · 7 comments
Open

Text format support for a Java WebAssembly runtime #224

kanha-gupta opened this issue Feb 4, 2024 · 7 comments

Comments

@kanha-gupta
Copy link

The task is to construct a Parser which converts Text format WASM Module and Generating output through AST using Domain classes already available in the project.
ANTLR is a suggested Parsing framework for the task.

@kanha-gupta
Copy link
Author

Hi @andreaTP, as you mentioned that we can either enable core parser functionalities first or enable custom parsers.
What do you think is the right approach ?

@andreaTP
Copy link
Collaborator

andreaTP commented Feb 5, 2024

No super strong opinion as far as we can get this effort started.

A possible approach would be to extract an interface for the Parser functionality.
The BinaryParser implementation will be the current implementation, and we should make the Parser instance injectable here.

In this way implementing new Parsers should be straightforward.
wdyt?

A couple of notes:

  • the Parser is not supposed to "generate output" but rather create a valid instance of a Module.
  • I suggested ANTLR because the generated code doesn't have dependencies and that's something we value in this project

cc. @mariofusco

@bhelx
Copy link
Contributor

bhelx commented Feb 7, 2024

I'm fine with antlr if @andreaTP is. Keep in mind that WAT is basically just s-expressions (with some caveats) so the parser really should be the easier part if you want to just do it by hand. But if Antlr gives us a better experience that sounds good to me too.

One thing I do want to note as a possible conflict is #208 as we're kind of refactoring some of the core wasm encoder and decoder layer. It might not be a problem, but maybe something we should talk about in the team meeting tomorrow.

@kanha-gupta
Copy link
Author

kanha-gupta commented Feb 9, 2024

@andreaTP @bhelx I will come up with a proposal soon. I will attach Screenshots of what is working best after going through a trial and error approach
Thanks a lot for your guidance :)

@electrum
Copy link
Collaborator

Note that ANTLR generated code depends on antlr4-runtime which has a strong dependency on the ANTLR generator version, so you would probably want to shade it.

@andreaTP
Copy link
Collaborator

After the merge of #328 we have a viable workaround for the lack of this implementation.
Having a native parser is still a goal but priority is decreased.

@kanha-gupta
Copy link
Author

After the merge of #328 we have a viable workaround for the lack of this implementation.
Having a native parser is still a goal but priority is decreased.

That's a brilliant approach

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

No branches or pull requests

4 participants