modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo/manual/
Other
23.37k stars 2.6k forks source link

[Feature Request] Allow unicode identifiers #1104

Open soraros opened 1 year ago

soraros commented 1 year ago

Review Mojo's priorities

What is your request?

Add support for unicode identifiers like in Python 3 (or better, like Swift/Julia).

What is your motivation for this change?

Any other details?

No response

Mogball commented 1 year ago

This is essential for emoji identifiers

soraros commented 1 year ago

@Mogball I tried very hard NOT to mention emoji identifiers.

Mogball commented 1 year ago

You can use backticks to escape any identifier, like

fn `🧠`(`😇🥹`: Int):
  print(`😇🥹`)

Is valid. But I agree for Python source compatibility, we should look into unicode identifiers without backticks.

lattner commented 1 year ago

Sure, of course we'll need to support PEP3131