Stream: general

Topic: Wit function name using _


view this post on Zulip baluchicken (Mar 31 2022 at 13:24):

Hi, is there a way to define wit function names using snake case? I tried to use the " or the % prefix but every time when I try to generate the bindings with the wit-bindgen rust-wasm I get the invalid character in identifier error.

view this post on Zulip Dan Gohman (Mar 31 2022 at 13:47):

Identifiers in wit are required to be kabob-case; this lets wit-bindgen map them to CamelCase or snake_case to match the conventions of different source languages.

view this post on Zulip Till Schneidereit (Mar 31 2022 at 21:55):

you should as a result see idiomatic identifiers in all languages, e.g. snake-cased in Rust, camel-cased in JS, etc


Last updated: Nov 22 2024 at 17:03 UTC