4 ms·
> Can you write JavaScript or Python or something using Japanese or Cyrillic characters? I believe identifiers in those languages have to be ascii characters
by imauld 8y 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 https://goplay.space/#whU6ErYq_wR
- jwilk 8y agoIn Python 2, identifiers are ASCII only. In Python 3, non-ASCII identifiers are supported: https://www.python.org/dev/peps/pep-3131/ https://www.python.org/dev/peps/pep-3131/
- tylerhou 8y agoJavaScript 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#examples https://mathiasbynens.be/notes/javascript-identifiers#exampl... d3.js used to also use Unicode identifiers: https://web.archive.org/web/20140802202152/https://github.com/mbostock/d3/blob/master/d3.js#L1185 https://web.archive.org/web/20140802202152/https://github.co... https://web.archive.org/web/20140802202152/https://github.com/mbostock/d3/blob/master/d3.js#L1210 https://web.archive.org/web/20140802202152/https://github.co...
- phaer 8y agoBoth Javascript and Python 3 do support unicode in variable names