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

Unable to use underscore in identifier #251

Closed
MarkintoshZ opened this issue Jun 17, 2022 · 3 comments
Closed

Unable to use underscore in identifier #251

MarkintoshZ opened this issue Jun 17, 2022 · 3 comments

Comments

@MarkintoshZ
Copy link

I wonder why using the underscore character in identifiers is not allowed here.

debug_function: func()

gives the following error

invalid character in identifier '_'
     --> input:1:1
      |
    1 | debug_function: func()
      | ^

Also, where could I find the formal definition for .wit files?

@sunfishcode
Copy link
Member

When wit-bindgen generates bindings for high-level source languages, it follows their naming conventions, such as using camelCase for JavaScript and snake_case for Rust, and so on. To be able to do this, it needs to be able to identify where the word separators are, so wit restricts the format to kebab-case.

There is not yet a formal definition for wit, though discussions have started about setting up a standards home for it.

@MarkintoshZ
Copy link
Author

Thank you. That makes sense.

@esoterra
Copy link
Contributor

For now, you can reference the WIT.md file in this repo

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

3 participants