Is there a programming language that uses characters other than those in the (non-extended) ascii table?
Asked Answered
S

9

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?

Sememe answered 5/11, 2010 at 21:16 Comment(4)
Do you have a link to this developer dvorak layout? It sounds interesting.Diverse
Not yet, although if there is interest I see no reason not to post about it in my blog. But the layout is actually a modified version of svorak (swedish dvorak) since Im from Sweden, I kinda need my åäö's. ;)Sememe
Yes, go to codegolf.stackexchange.com, and there you will find many examples.Slemmer
They all are esolangs though (except some)Slemmer
S
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:

Sterigma answered 5/11, 2010 at 21:17 Comment(3)
A perfect answer! :) Although, I was hoping for a few silly ideas before something like this popped up.Sememe
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.Moton
Nope, not a perfect answer... the image was hotlinked, which made it prone to break as it did...Idaliaidalina
R
9

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

Reliquary answered 23/8, 2011 at 6:22 Comment(0)
C
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.

Claudioclaudius answered 6/11, 2010 at 9:20 Comment(0)
B
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.

Bonita answered 5/11, 2010 at 21:47 Comment(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.Reliquary
H
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.

Hebrews answered 5/11, 2010 at 21:33 Comment(3)
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.Urano
"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): web.archive.org/web/20110215081951/http://developer.apple.com/…Moton
@Alhadis Dang, everything disappears in time, I guess. Thank the gods for the Wayback Machine!Hebrews
S
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.

Starknaked answered 5/11, 2010 at 21:46 Comment(0)
U
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 "^").

Urano answered 5/11, 2010 at 22:9 Comment(0)
R
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
Recommendatory answered 27/9, 2012 at 6:53 Comment(1)
Yes but does the syntax use Chinese? I can't tell.Argumentation
M
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 ▼ ->
    ★ <| (▼ -★- ▼) |> °
Martymartyn answered 4/4, 2013 at 4:49 Comment(1)
The extended characters are allowed here, but they're not part of the syntax of the language itself. So it doesn't really count.Argumentation

© 2022 - 2024 — McMap. All rights reserved.