eeue56 / derw

An Elm-inspired language that transpiles to TypeScript
BSD 3-Clause "New" or "Revised" License
374 stars 9 forks source link

Unicode operator support? #6

Open toastal opened 2 years ago

toastal commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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.