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

relax the var to allow utf8 encoding in the wat syntax #1618

Open
bobzhang opened this issue Mar 4, 2023 · 2 comments
Open

relax the var to allow utf8 encoding in the wat syntax #1618

bobzhang opened this issue Mar 4, 2023 · 2 comments
Labels
i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response.

Comments

@bobzhang
Copy link

bobzhang commented Mar 4, 2023

According to the reference interpreter

let symbol =
  ['+''-''*''/''\\''^''~''=''<''>''!''?''@''#''$''%''&''|'':''`''.''\'']
let letter = ['a'-'z''A'-'Z']
let idchar = letter | digit | '_' | symbol
let name = idchar+
let id = '$' name

  | id as s { VAR s }

Currently I can only write ascii letters in the wat syntax, (local $var).
It is a bit awkward to encode other utf8 letters in the wat syntax,
so people can write (local $你好).

It is a bit worse in the current situation, since no escaping syntax supported so
we have to do some magic encoding here

@bobzhang
Copy link
Author

bobzhang commented Mar 4, 2023

seems to be relevant to #617, the title is a bit misleading, it is not strange symbols though

@rossberg
Copy link
Member

rossberg commented Mar 4, 2023

Yes, this is as spec'ed in the standard, and it is rather intentional that program text (outside strings and comments) is limited to plain ASCII. Unicode identifiers are a can of worms, as explained in the other issue.

The ability to annotate richer print names is part of the annotations proposal.

@xfq xfq added the i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response.
Projects
None yet
Development

No branches or pull requests

3 participants