4 ms·
> Why I care about ASCII here? Because programming language source code is still written in that, and it's also those symbols that appear on standard US keyboar
by nothrabannosir 8y ago
> Why I care about ASCII here? Because programming language source code is still written in that, and it's also those symbols that appear on standard US keyboard layout.
None of the programming languages I've used in the last ten years, save perhaps brainfuck, used ASCII. It was all unicode, either through explicit configuration atop the source code file, or e.g. UTF-8 by default.
- Aardwolf 8y agoI mean core language keywords and operators, not strings or custom variable names. The core set is limited set for good reason, but a few more symbols could have helped, e.g. degree symbol is very common and could have been used for angles. Did you know in C++ you can have a variables named as emoji? It compiles with clang++ with -std=c++11 :) APL is a famous non-ASCII based programming language using arrows and such, but very difficult to type on a modern computer of course. Other than esoteric languages, I don't know any modern programming languages using non-ASCII symbols in core keywords and operators.
- lalaithion 8y agoHaskell has Unicode synonyms for many of it's constructs (enabled by a compiler flag), so you can write eg. → instead of `->` and ∀ instead of `forall`.
- aduitsis 8y agoPerl6 too.
- lizmat 8y agohttps://docs.perl6.org/language/unicode_ascii https://docs.perl6.org/language/unicode_ascii for a list of Unicode characters in Perl 6 and their ASCII counterparts.
- pmarreck 8y agoI get that "for free" via programming ligatures: https://github.com/tonsky/FiraCode https://github.com/tonsky/FiraCode Depending on your (irrational) feelings about fonts and typography, this may either be the most amazing advance in coding readability you've ever encountered, or a mild improvement, or even annoying. But I love them! A number of coding-oriented fonts support them now: https://medium.com/larsenwork-andreas-larsen/ligatures-coding-fonts-5375ab47ef8e https://medium.com/larsenwork-andreas-larsen/ligatures-codin... also, small grammar niggle: "it's" should only be used where it can be replaced with "it is" and still make sense; otherwise it's always "its" :)
- reificator 8y agoFira code is great, but it can confuse others when they're looking over your shoulder. I consider it essential when working with Javascript, thanks to the ~~boneheaded and objectively wrong~~ personal-opinion-based decision to make the strict equality operator longer than the coercive one. Making sure you have the right one is important, and while linters can also solve the problem, I like having it be very visual and obviously apparent. Regarding `it's`: https://www.youtube.com/watch?v=063jQAM6N8I https://www.youtube.com/watch?v=063jQAM6N8I
- pmarreck 8y agoI thought I was familiar enough with Monty Python but I've never seen these, hilarious! (also the gag at 3:10)
- leiroigh 8y agoFor some reason, julia has no ascii infix xor. That is, you can write `xor(a,b)` or `a ⊻ b` (`^` is taken for "raise to power").
- guitarbill 8y agoHow do you type "⊻"? I think it'd rather avoid a language where I can't type all the operators. Still, could be worse, some languages allow unicode identifiers, and fun ensues. (You can allow unicode to appear in source files - either in inline documentation or strings - without allowing unicode identifiers. But even in languages that support this, I usually escape non-ASCII characters)
- thaumasiotes 8y agoWhere did ⊻ come from? The only symbol I ever learned for xor was ⊕. (Though I see that according to wikipedia, "It is symbolized by the prefix operator J and by the infix operators XOR, EOR, EXOR, ⊻, ⩒, ⩛, ⊕, ↮, and ≢.")
- dpark 8y agoYou just want some extra keyboard characters. That’s got nothing to do with ASCII. You’ll notice that you also don’t actually have literal control character keys on your keyboard.
- nothrabannosir 8y agoThe characters commonly found in programming language syntaxes are a subset of the standard ANSI 101 keyboard layout. It makes them easy to type. It is however, especially today, a completely separate issue from encoding. Having more characters in ASCII won’t make a dent without having them on most keyboards, and having them on a keyboard is enough to encourage adoption without having them in the ascii code plane.
- paulddraper 8y agoScala has core non-ASCII syntax elements. (Though they also have ASCII equivalents of those you can use instead.)
- jandrese 8y agoI remember a comment a few years ago about Perl6 picking up the Japanese style quotation marks「 and 」for some purpose. Might have been tongue in cheek.
- lizmat 8y ago「 and 」are indeed used in Perl 6 when textually representing a Match object (the Match.gist). See https://docs.perl6.org/language/unicode_ascii https://docs.perl6.org/language/unicode_ascii for other acceptable unicode characters (and their ASCII counterparts) in Perl 6.