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

Unicode operator support? #6

Open
toastal opened this issue Mar 1, 2022 · 3 comments
Open

Unicode operator support? #6

toastal opened this issue Mar 1, 2022 · 3 comments

Comments

@toastal
Copy link
Contributor

toastal commented Mar 1, 2022

PureScript, Haskell (with UnicodeSyntax extension), Dhall, and Agda all support Unicode for operators (as well as custom infix operators). Users can choose to express themselves however they feel.

print :: forall a. a -> String

is just as valid as

print   a. a  String

Some chose to create alternative Preludes to express even more code on both type and term-levels this way. With tooling like purescript-tidy allowing users to specify data UnicodeOption = UnicodeSource | UnicodeAlways | UnicodeNever project-wide the preference.

Other languages like Gluon and Idris have explicitly stated that they do not want want this support because it can create yak-shaving, scares some users off with questions of: how do I type this ‘fancy’ symbol, and offer two ways to do something instead of one.

As someone in the camp that finds ligatures in programming fonts a bad idea and thinking it’s better if you can express your symbol using Unicode if that's what you mean to show and don't want false positives, I prefer the Unicode side, however I can understand the argument from the other side.

Does derw have a stance on future Unicode support (or defer til later)?

@eeue56
Copy link
Owner

eeue56 commented Mar 19, 2022

I'm not a fan of ligatures myself. By default it will match whatever Typescript (i.e Javascript) supports, which allows for UTF-8 characters in source. I think that's generally a bad idea though, and untypable characters that majority of people can't write is a bad idea. Though there's always cases like ascii (and UTF-8) being a westernized set of characters, particularly English characters. I see that there is a decent Japanese following for Derw, so perhaps someone from a non-Western country will have a need for unicode chars.

@toastal
Copy link
Contributor Author

toastal commented Mar 20, 2022

A lot of people still have troubles using $ with their keyboard too so it's not as black and white as there's no guarantee of any keys. Heck the default, QWERTY-equivalent in Thailand doesn't even have Arabic numerals let alone ASCII.

@turboMaCk
Copy link

I also feel it might not be good idea to support Unicode at least when it comes to identifier names. Unicode is full of characters that are almost impossible to tell one from the other. ASCII is not perfect but it's well defined subset at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants