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

Finish all the validation for the interpreter #440

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

andreaTP
Copy link
Collaborator

@andreaTP andreaTP commented Jul 23, 2024

I'll clean this up tomorrow, there are probably leftovers around as I was going back and forth fixing stuffs.

Screenshot from 2024-07-23 19-10-13

import com.dylibso.chicory.wasm.types.Table;
import com.dylibso.chicory.wasm.types.Value;
import com.dylibso.chicory.wasm.types.ValueType;

public class SpecV1ElemHostFuncs {

public static HostImports fallback() {
return new HostImports();
return HostImports.builder()
.addGlobal(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: this API is better than before, but is still too verbose and detailed for 90% of the use cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, i have some words to say about this in #441

return HostImports.builder()
.addFunction(
new HostFunction(
(Instance instance, Value... args) -> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: HostFunction constructor is the only Host constructor that doesn't take the two strings for the name as first arguments

@andreaTP andreaTP marked this pull request as ready for review July 24, 2024 13:40
@andreaTP andreaTP changed the title Finish all the validation for the interpreter. Finish all the validation for the interpreter Jul 25, 2024
@electrum
Copy link
Collaborator

I'm traveling for the next two days and can review when I return home.

It will be easier to review if you can split out the API refactoring to a separate commit from the functional changes.

@andreaTP
Copy link
Collaborator Author

Thanks for the feedback @electrum !

I might try to separate in 2 commits, but is challenging, apart from a few trivial things, the biggest part of it is driven by this change: https://github.com/dylibso/chicory/pull/440/files#diff-fadb7963eded2e2c77d87d70b45f81ab8b4ea0cffff5a68695cead4732c5f6b1R225

We had a bug in the tests generation and now the generated code looks different.

@andreaTP
Copy link
Collaborator Author

Thanks for the reviews! Appreciated!

@andreaTP andreaTP merged commit ab1c61f into dylibso:main Jul 29, 2024
13 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.

3 participants