+4  A: 

In my opinion they have no place in a language, but definitely belong in a default preprocessor. You may get the APL-keyboard problem though. (and possible visual ambiguity).

A limited example of this as a pre/post processing would be cweaved code.

vlabrecque
A preprocessor may be just the ticket, though I had been avoiding including one in favour of a more structured system based on templates.
Jon Purdy
+2  A: 

It's an interesting concept, but aren't you worried that multiple spellings of the same thing will make parsing the code more difficult, especially for IDE's? Not to mention the additional time taken to teach what those symbols mean to incoming new programmers? If you're supporting unicode and therefore possibly other languages (variables in japanese?), these make another layer of inscrutability. In addition, how useful have you found their logical opposite, the C trigraph ( http://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C )? :-)

eruciform
With my current set-up, adding alternate spellings for operators is trivial, and editors really only need to know that alternate spellings exist, not which are synonyms. I intend to support not only non-English variables, but *keywords* too (like ChinesePython). I haven't needed trigraphs at all, but nowadays a keyboard is almost guaranteed to have the characters needed for C. The single symbols are from maths and should be *easier* to remember. For example, it took me a while to break my dyslexic friend of his habit of writing `=<` instead of `<=` because of the symmetry with `>=`.
Jon Purdy
@Jon perhaps your friend is a Prolog programmer?
Norman Ramsey
@Norman: Since I've seen everything he's written, and since none of it has been in anything other than Java, C++, or VHDL, somehow I have my doubts. But you never know what people get up to when nobody's looking.
Jon Purdy
@Jon: in-joke. In Prolog, 'less than or equal' is spelled `=<` because they wanted to keep `<=` available to spell 'left arrow'.
Norman Ramsey
+6  A: 

Special characters have any place in a modern, non-academic language?

Yes, but because on most desktops the support for special characters is still awful (bad editors, bad fonts, you name it),

  • You better be planning ten years ahead.
  • You better be very sure there is a good, usable alternative using only ASCII characters.

I would never advocate a preprocessor: there is too much temptation and room for abuse, and unless it is done very carefully, a preprocessor makes it much harder to write good IDEs and static-analysis tools.

Some people like a postprocessor, i.e., a prettyprinter, that takes sequences of ASCII characters and renders them as something else. While I have always found this style dreadfully confusing, it is quite popular and successful among some Haskell programmers.

Norman Ramsey
Shannon Severance
I suppose if I wanted editor support done right, or done at all, I'd have to do it myself. My current thinking is that the "preprocessor" will operate strictly between alternate spellings, for presentation and inter-language purposes. The hope is that it could be used either forward or backward, and thus as either a preprocessor or a pretty-printer.
Jon Purdy
A: 

I like the idea of using the proper characters a lot. However, in order to use then I would really want a keyboard that had extra punctuation keys to be used for them. And while we're at it, things like { } ( ) " ? + * should all be on their own keys too.

Coxy
We need a programmers keyboard.
GONeale
@GONeale: Hell yes. A while back, I gave up and changed my keyboard layout, swapping digits with symbols, and other common shift-symbols with their non-shift counterparts. It's made my coding worlds faster and more comfortable.
Jon Purdy
A: 

Not sure about a general purpose language, but these have a place in a DSL for a domain where they're sensible. And it can certainly be done in some modern languages. For an example in Scala, see this blog post.

Don Roby
+2  A: 

The special characters and are reserved words in Scala. is used for introducing generator bindings whereas is used in the function definitions to separate parameter lists from the function body.

Examples:

for {
  word ← List("Hello", "World")
  character ← word
} println(character)

val square = (x: Int) ⇒ x * x

It should be noted that Scala compiler also allows the ASCII alternatives of the above symbols (i.e. <- and =>).

missingfaktor
A: 

The one language I've used that relies on non-ASCII characters is TI-BASIC, which uses for assignment, // for comparison, has built-in constants π and , a function, etc.

On the PC, I doubt that'd I'd use non-ASCII operators much, simply because it's so much quicker to type != than it is to look up in character map.

dan04
Ah! I'd forgotten about that. The only reason they can get away with it is the specialised keyboard, combined with the fact that users accept that the typing speed is low on a calculator.
Jon Purdy
A: 

Isabelle (the theorem prover) allows LaTeX-style command sequences as valid inputs. Various front-ends then do appropriate things to turn these into special characters. The nice result of this is that it's still just vanilla ASCII text, but you can have all the nice pretty display characters looking as you expect in an editor that is aware of those characters.

Gian