Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unicode based programming language

This is a curiosity more than anything: Does there exist a programming language that allows variables, functions, and classes to be named using using Unicode rather than ASCII (except, of course, for special characters such as '+')? Do any popular languages have support for this?

Also, related to this, if any common language supports Unicode, then is there any way to convert an existing API into a language of the user's own choice? It seems like it would be helpful to give a programmer the ability to learn an API in their own language. I imagine downloading a standard API (for instance boost) and then downloading the standard translation mapping and then being able to program in my native language.

like image 459
JnBrymn Avatar asked Oct 14 '10 14:10

JnBrymn


People also ask

Is Unicode used in programming language?

This article contains uncommon Unicode characters.The standard has been implemented in many recent technologies, including modern operating systems, XML, and most modern programming languages. The Unicode character repertoire is synchronized with ISO/IEC 10646, each being code-for-code identical with the other.

Is Java a Unicode language?

As Java was developed for multilingual languages it adopted the unicode system. So lowest value is represented by \u0000 and highest value is represented by \uFFFF.

Is Java ASCII or Unicode?

Java actually uses Unicode, which includes ASCII and other characters from languages around the world.

What type of code is Unicode?

Unicode is made up of lots of code points (mapping lots of characters from around the world to a key that all computers can reference.) A collection of code points is called a character set - which is what Unicode is.


2 Answers

Consider Swift, introduced by Apple in 2014. Here is a code snippet:

var 国 = "美国"

Good Luck with your search for the best one!

like image 184
Ram Avatar answered Oct 25 '22 02:10

Ram


As you can see from other answers, most modern languages allow this, including Perl, Python, Go, Ruby, Java, C♯, variants of lisp, Fortess, ADA, and many more. C and C++ do not, but those aren’t modern.

Regarding C♯, from MSDN:

The rules for identifiers given in this section correspond exactly to those recommended by the Unicode Standard Annex 15


As for converting an API to a chosen language - this is not feasible. You would require a translator that understands the nuances and meaning of every method, variable and class name and translate those correctly - this is not the same as being able to use the characters of a chosen language in code.

like image 39
Oded Avatar answered Oct 25 '22 04:10

Oded