14

I cant see who would make such a decision but is there any such language?

The reason I ask this (or some trivia, if you like) is that I just finished making the eighth iteration of my "developer" version of dvorak (big emphasis on special characters). And four keys are currently not used!

Since I dont ever want to stumble upon a new language to try, only to find out that my layout lacks a crucial special character I decided to ask the community.


If there never is a need for any other characters besides the basic ones, what would be the best use (for a programmer of course, this is SO) of unused keys? Something from the extended ascii table? Or purposefully leave them unused and do something cool with with AutoHotKey?

starblue
  • 55,348
  • 14
  • 97
  • 151
Mizipzor
  • 51,151
  • 22
  • 97
  • 138

9 Answers9

20

Yes, there is (at least one): APL

Here is Conway's Game of Life written in APL:


(source: wikimedia.org)

It uses this keyboard mapping:

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Gabi Purcaru
  • 30,940
  • 9
  • 79
  • 95
  • A perfect answer! :) Although, I was hoping for a few silly ideas before something like this popped up. – Mizipzor Nov 05 '10 at 21:22
  • I love the fact this language evolved from pure mathematical notation, the fact it has dedicated Unicode symbols, they fact they actually look really spiffy, and the fact that most programs are shorter than this sentence I've just written. –  May 01 '18 at 12:29
  • Nope, not a perfect answer... the image was hotlinked, which made it prone to break as it did... – Jasper Nov 26 '20 at 21:46
8

The de-facto standard Haskell implementation, GHC, supports Unicode syntax if

{-# LANGUAGE UnicodeSyntax #-}

is specified at the top of a file. This lets you use for function types and lambdas, for type classes, for list comprehensions, etc..

More precisely, the supported syntax is:

 ASCII   Unicode alternative
 ::      ∷ U+2237 PROPORTION
 =>      ⇒ U+21D2 RIGHTWARDS DOUBLE ARROW
 forall  ∀ U+2200 FOR ALL
 ->      → U+2192 RIGHTWARDS ARROW
 <-      ← U+2190 LEFTWARDS ARROW
 -<      ↢ U+2919 LEFTWARDS ARROW-TAIL
 >-      ↣ U+291A RIGHTWARDS ARROW-TAIL
 -<<       U+291B LEFTWARDS DOUBLE ARROW-TAIL
 >>-       U+291C RIGHTWARDS DOUBLE ARROW-TAIL
 *       ★ U+2605 BLACK STAR

Further, various libraries provide Unicode operators (using Haskell's support for Unicode characters in operator names): http://www.haskell.org/haskellwiki/Unicode-symbols

Mechanical snail
  • 29,755
  • 14
  • 88
  • 113
5

Fortress, a mathematical/scientific programming language developed by (among others) Java's Guy L Steele when he was still at Sun, extensively uses Unicode mathematical operators etc.

Not only is there a defined ASCII representation of the language, there's also a defined way of converting the ASCII into a 'rendered' version using TeX. You can also (as I understand i) use Unicode operators directly in your source -- there's just an ASCII 'shortcut' for stuff that's hard to type (as I understand it -- I'l admit I'm not sure on this point).

The site has an example of the source and how it's rendered.

Cowan
  • 37,227
  • 11
  • 66
  • 65
3

C# allows variables to contain Unicode characters. For example, the character ɢ (Latin Small Capital G, U+0262) is a perfectly valid character in a C# variable.

Jim Mischel
  • 131,090
  • 20
  • 188
  • 351
  • 1
    Also Java, Python, Haskell, etc., and most other modern programming languages. Lisp-family languages, Haskell, and Scala in particular let you define custom unicode operators. – Mechanical snail Aug 23 '11 at 06:16
2

The scripting language for the old Macintosh Programmer's Workshop (MPW) used lots of non-ASCII characters to implement what was basically a version of the Unix shell. In fact, some of the documentation is still available. It used ∑ for redirection, for example.

ebneter
  • 20,795
  • 9
  • 30
  • 30
  • I liked MPW's use of characters for redirection; it had separate characters to redirect stdout, stderr, or both. I'm not sure by what means, if any, one could do likewise in Unix. – supercat Jan 24 '14 at 16:40
  • *"some of the documentation is still available."* Not anymore, the URL now redirects to a landing page. The page was cached by the Wayback Machine, however (Feb 2011): http://web.archive.org/web/20110215081951/http://developer.apple.com/tools/mpw-tools/commandref/appc.html –  Apr 08 '18 at 14:10
  • @Alhadis Dang, everything disappears in time, I guess. Thank the gods for the Wayback Machine! – ebneter Apr 30 '18 at 22:46
1

Would this count?

Chinese version of Python
http://www.chinesepython.org/doc/tut/tut/node3.html

Chinese:

>>> 甲 = 12
>>> 乙 = 3
>>> 甲 + 乙
15
>>> 甲 + 乙**乙
39
>>> 甲 = 0 #(可以重新指定值)
>>> 乙 = 甲 + 1
>>> 寫 乙
1

English:

>>> j = 12
>>> y = 3
>>> j + y
15
>>> j + y**y
39
>>> j = 0
>>> y = j + 1
>>> print y
1
ains
  • 1,436
  • 4
  • 18
  • 33
1

My fork of F# : https://github.com/Heather/fsharp

let ° msg = System.Console.WriteLine( msg.ToString() )

let ◄ = 5
let ★ x = x + ◄
let (-★-) x y = x + y

let © = "© 2013"

let ► =
    fun x -> 2 + x

sprintf  "Heather %s" project version © |> °
► ◄ |> fun ▼ ->
    ★ <| (▼ -★- ▼) |> °
cnd
  • 32,616
  • 62
  • 183
  • 313
  • The extended characters are allowed here, but they're not part of the syntax of the language itself. So it doesn't really count. – CommaToast Nov 12 '14 at 23:51
1

Perl 6 has optional Unicode operators, as well as the ability to add user-defined operators.

You probably shouldn't wait for it before remapping your keys. I don't know if Rakudo can work with Unicode operators yet.

Charles
  • 50,943
  • 13
  • 104
  • 142
1

PL/I uses an upside-down-L character for the "not" operator; the VM360 I used once upon a time used "^" as the ASCII equivalent (I don't think EBCDIC had "^").

supercat
  • 77,689
  • 9
  • 166
  • 211