Adding Unicode operators to D

bearophile bearophileHUGS at lycos.com
Thu Oct 23 02:08:36 PDT 2008


Andrei Alexandrescu:

Few random thoughts on the subject:
- Someday probably programming languages will use some Unicode symbols. I don't know if Fortress will succeed, but I think someday some language will do. Probably Unicode symbols will be used as in Fotress, for improve the readability of the code, and not as in APL to transform the code into hieroglyphics.
- Another good thing that Fortress does is that there are always *nice* looking ways to write the same code in pure ASCII. So there are usually intuitive 2 or 3 char long translations of all the accepted Unicode symbols. This is very positive, so you can write/read Fortress with a normal ASCII editor too.
- My editor, programming font, newsreader, IDEs, and probably more things, currently have problems with Unicode texts.
- Novels in English and other languages show that you can express very complex and refined thoughts with just very few characters. But you need some space to write a novel/short story. Mathematics shows that a judicious usage of standard and widely used symbols helps a lot in decreasing the space used to represent formulas, etc.
- Fortress and the Mathematica language are designed for physics and mathematics. D language can be used for that, but it's mostly a system language. So symbols are more used and more important in Fortress than D. So their purposes and targets are different.
- I like the idea of using *few* Unicode symbols in my programs, they can reduce code size and they may even improve readability.
- Python3 allows Unicode identifiers, mostly to allow people in all part of the world to write variable names in their languages.
- But seeing the disadvantages in the end I think that in practice adopting Unicode for D programs is currently bad.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list