Hacker News new | ask | show | jobs
by imauld 2958 days ago
> Can you write JavaScript or Python or something using Japanese or Cyrillic characters?

I believe identifiers in those languages have to be ascii characters but I'm not 100% sure. Go however allows any valid unicode character for variable names. The rest of the language is in English though.

Valid Go w/ variable in Japanese: https://goplay.space/#whU6ErYq_wR

3 comments

JavaScript identifiers can be emoji, I think. This is also valid JavaScript (you can test it by pasting it into your console):

  let ಠ_ಠ = "Hello, world!";
  alert(ಠ_ಠ);
Some more examples: https://mathiasbynens.be/notes/javascript-identifiers#exampl...

d3.js used to also use Unicode identifiers:

https://web.archive.org/web/20140802202152/https://github.co... https://web.archive.org/web/20140802202152/https://github.co...

In Python 2, identifiers are ASCII only.

In Python 3, non-ASCII identifiers are supported:

https://www.python.org/dev/peps/pep-3131/

Both Javascript and Python 3 do support unicode in variable names