The Seven Tongues of Sorted!
In 2000, Sorted! was bilingual, and I claimed it was the only programming language in the world that could understand both English and German code. Nobody ever contradicted me, which I took as confirmation.
Twenty-six years later it speaks seven languages. Since every program consists of the same fourteen sentences, each sentence only had to be translated once per language, which makes Sorted! the easiest language to localize in the history of computing, and the most pointless.
The tongues
- English, as in 2000. Fifteen is "fiveteen". This is not up for discussion.
- German, as in 2000, now with umlauts, if you are very. In the German of 2000 a thousand is "einstausend" and a million "einsmillionen". The German of 2000 also had no words for ratios, logical operations or lists of ordered differences, so German programs said those sentences in English. Very Sorted! finally taught German the missing words.
- Italian, which was born after the interpreter had spoken and so inherited none of its properties. It has a form for every sentence, every form parses as written, and its numbers know zero ("zeresimo") and the negative ("meno sette"). Italian is the only tongue of Sorted! that has never sinned.
- The French of Vaud, the only French that Sorted! speaks, because it counts the way everybody wishes French counted: seventy-two is septante-deux, eighty-seven is huitante-sept. It also says "eh", "hein", "quoi" and "voilà" where others pause, and the parser hears those as the silence they are.
- Brazilian Portuguese, which joins its numbers with the same "e" that joins its lists. Where two numbers would melt into one, the renderer sets a comma between them, so that each may stay itself.
- Japanese, in Latin letters, which only says what it does at the very end, as the patient do. It counts in tens of thousands. In it the sum and the topic marker are the same word, wa, and the parser tells them apart by where they stand.
- Mandarin, in two scripts: hanzi, which need no spaces, and pinyin, which needs its tones. In Mandarin "and" and "sum" are the same character, 和, which makes "the sum of a and b" a philosophical statement.
Here is the beginning of Hello, World. in Vaud, straight out of sorted --lang fr hello.s:
Ce programme utilise les nombres
zéro,
un,
septante-deux,
cent-un,
cent-huit,
deux-cents,
cent-onze,
quarante-quatre,
trente-deux,
huitante-sept,
...
Ce programme, eh, écrit
la cellule indexée par le premier nombre comme caractère.
Ce programme ne peut pas lire.
Ce programme utilise la somme du premier nombre et du deuxième nombre.
Ce programme, hein, utilise
la condition que le seizième nombre soit égal à la cellule indexée par le premier nombre.
And this is how the same program declares its fourteen statements' worth of patience in Japanese: thirteen lines of things to implement, and then, at the very end, the verb.
Kono puroguramu wa
dai-ichi no dainyū,
...
to dai-ni no raberu o jissō shimasu.
Kono puroguramu wa hi o tsukaimasen.
Kono puroguramu wa hironriteki desu.
Kono puroguramu wa totemo totemo kakkoii desu.
"Kono puroguramu wa hironriteki desu" means "this program is illogical". It is the Japanese way of saying that it uses no logical operations, and it is also simply true.
Name a language in any language
Sorted! is non-judgmental. You can name a language in any language Sorted! speaks: --lang deutsch,
--anglais, --英語, --yingyu, --Waadtländisch. Accents and case don't matter, and neither do pinyin tone
marks. There is a full matrix of seven languages times seven languages plus the regional names, and "italiano"
means the same thing in Italian and in Portuguese, which was a great relief to everybody involved.
For the same reason, sorted --from-c writes its output in a language picked at random unless you ask for one,
and sorted --help explains itself in a random language. English was considered as a default, and rejected
as judgmental.
Babel mode
At Babel the tongues were confounded, so that nobody understood anybody. Sorted! does it the other way round.
Name several languages, and every sentence is written in one of them, picked at random, in turn, or by the fewest
syllables (--mix random, --mix alternate, --mix singable). The program means exactly one thing in all of them,
because the text is read back into the parsed tables and has to come out identical, or it is not written.
This is Hello, World. in all seven tongues, one sentence each, in turn
(sorted --lang en,de,it,fr,pt,ja,zh --mix alternate hello.s):
This code uses the numbers
zero,
one,
seventytwo,
onehundredone,
onehundredeight,
twohundred,
onehundredeleven,
fourtyfour,
thirtytwo,
eightyseven,
twohundredone,
onehundredfourteen,
twohundredtwo,
onehundred,
fourtysix,
and twohundredtwentytwo.
Dieses Programm
springt immer an das erste Sprungziel,
und springt manchmal an das zweite Sprungziel wenn die erste Bedingung wahr ist.
Questo programma scrive la cella indicizzata dal primo numero come carattere.
Ce programme ne peut pas lire.
Este programa usa a soma do primeiro número e do segundo número.
Kono puroguramu wa
dai-jūroku no kazu ga dai-ichi no kazu ga sasu seru to hitoshii to iu jōken o tsukaimasu.
这个程序使用两个标签。
This code does not use any ordered differences.
Dieses Programm weisst zu
die fünfte Zahl an die sechste Zahl,
die erste Zahl an die sechzehnte Zahl,
die erste Summe an die erste Zahl,
die siebente Zahl an die elfte Zahl,
und die fünfte Zahl an die dreizehnte Zahl.
Questo programma non usa prodotti.
Ce programme implémente
la première affectation,
la deuxième affectation,
la troisième affectation,
la quatrième affectation,
la troisième affectation,
la cinquième affectation,
la troisième affectation,
la première étiquette,
le deuxième saut,
la première sortie,
la troisième affectation,
le premier saut
et la deuxième étiquette, voilà.
Este programa não usa nenhuma razão.
Kono puroguramu wa hironriteki desu.
这个程序非常非常酷。
$ sorted babel.s
Hello, World.
Which brings us to the one claim on this site that I can back up completely. Sorted! is the only machine translator in the world with a hundred percent accuracy, as long as you only ever say one of fourteen things. Its competitors can say anything at all, with somewhat less than a hundred percent accuracy. Choose wisely.
The full table of every sentence in every language is in the language reference.