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

Validation #7

Open
fitzgen opened this issue May 16, 2019 · 4 comments
Open

Validation #7

fitzgen opened this issue May 16, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@fitzgen
Copy link
Member

fitzgen commented May 16, 2019

Should be able to take an AST and some extra wasm typing context (probably expressed as a trait) and validate that the bindings described by the AST are well-formed.

@fitzgen fitzgen added the enhancement New feature or request label May 16, 2019
@fitzgen

This comment has been minimized.

@Hywan
Copy link
Contributor

Hywan commented Jul 2, 2019

Do you consider supporting type-checking when validating? By type-checking, I mean: The following Web IDL is valid:

type $hello_webidl_type
  (func
    (result ByteString))

func-binding $hello_webidl_binding export $hello_wasm_type $hello_webidl_type
  (result
    (utf8-cstr ByteString 0))

… whilst the following is invalid:

type $hello_webidl_type
  (func
    (result DOMString))

func-binding $hello_webidl_binding export $hello_wasm_type $hello_webidl_type
  (result
    (utf8-cstr ByteString 0))

… because the $hello_webidl_type type defines a function that returns a DOMString and $hello_webidl_binding represents a function binding that returns a ByteString through the utf8-cstr constructor.

I've a very naive algorithm that works with the AST only. If this is something required, I can improve the code and open a PR.

@fitzgen
Copy link
Member Author

fitzgen commented Jul 2, 2019

Yes, validation would do type checking. I'm not quite ready for a PR for this yet though, I need to think about it a bit more and talk with the folks writing the standards and things like that to make sure it helps push that side of things forward.

@Hywan
Copy link
Contributor

Hywan commented Jul 3, 2019

OK. Please ping me to keep me in the discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants