2006-12-07

Programming without ASCII

Mind is a Japanese programming language in the sense that you write code for it in Japanese. For example, it looks like the Mind "Hello world" program would be:

メインとは
  「こんにちは、世界!」を 表示し
  改行すること。

Wikipedia's entry for Mind notes that it is based on Forth, a stack-oriented programming language (summary: "1 2 + 3 *" instead of "(1 + 2) * 3"). Which makes sense, because as I suppose virtually all of my readers know, you can think of the Japanese language in a similar way: as a sentence progresses, the "stack" fills up with topics, adverbs, etc., until the verb at the end ties them all together and finishes the statement. (Obviously, real Japanese as she is spoke isn't always this neat and tidy, brains don't comprehend language like computers parse it, etc., but you get the idea.)

Nadeshiko is another Japanese programming language, a less interesting scripting one with (Windows) GUI functionality, in Japanese. It's based on an older one called Himawari, and you can find lots of related links where you might expect.

This is probably as good a place as any to note that around these parts "C++" is affectionately abbreviated to Shii pura [pura].

Popularity factor: 9

Leonardo Boiko:

Thanks for an interesting post. I first heard of Mind on kuro5hin a long time ago.


Denske:

One cavil: these languages definitely use ASCII in places, so your title is a bit of a misnomer.

I first came across this concept around 1990, using the scripting language on the database 4th Dimension on the Mac in Japanese.

I was surprised when I showed it to Japanese programmers and they expressed no interest in it.

On the other hand, since my first programming language was APL, which required a special keyboard due to the special characters (35 non-English characters, mainly Greek), with expressions evaluated from right to left, and I didn't find it at all unusual or tough, I doubt many Japanese programmers find programming in ASCII problematic.


Anonymous:

This is just plain cool. :)

Incidentally, my reaction when I read my first japanese grammar was "wow, this is just like Postscript!". I've always wondered if there has been any studies about whether japanese speakers find it easier to learn stack-based programming langauge than english speakers.

Vilhelm


Matt:

Leonardo: Man, that guy on kuro5hin sure is passionate.

Denske: You're absolutely right, even the sample sentences use the ASCII line break character. I was being sensationalistic for the sake of it.

I share your doubts about the idea that Japanese programmers have trouble with using the standard languages that borrow English vocabulary -- it isn't like those languages are that close to English anyway, except the ones that are trying to be. Probably the thing about these languages is not just that they use Japanese vocabulary but that they make an effort to use words instead of symbols (so that functions are defined by とは...こと。 instead of {...}, etc.) I guess they're really just a subset of the "program in human language, not squiggles and code!" thing that takes advantage of certain usual similarities between Japanese and Forth. Which makes the target audience "academics interested in the idea, and people who want to make computers do things without actually becoming part of the mainstream programming community".

Vilhelm: One of those pages claims that "research" has shown that it does make it easier for Japanese speakers when the language uses Japanese, but I'm skeptical. I don't think that understanding the original human meaning of the reserved wordset is the big problem in learning to program; it's more about language-independent things like learning how computers work, breaking tasks down into smaller pieces and thinking up algorithms that produce the results you want.


Anonymous:

Matt: Yeah, I'm not too convinced either, about the helpfulness of making programming languages imitate natural language. (An interesting example of that idea, though, is AppleScript, which came in English, French and Japanese "dialects",with the same underlying representation. I have never used Applescript at all, so I can't say, but it seems that doing it that way must be even more difficult than picking a single language).

But anyway, rather than such lexical details I am much more interested in how japanese speakers cope with the "reverese word order" of stack languages.

Certainly for me at least it was a big mental "jump" to make to learn to think in terms of "mumble mumble get" instead of "get mumble mumble", even though the transformation is of course trivial to describe -- my brain just didn't feel adjusted to writing down programs in that order.

BUT, a native japanese speaker should already "come equiped" with some syntactic processing hardware for doing just that! (Though my own guess would be that it probably doesn't help too much. (And besides, the order [relative clause] [noun] is no good for stack-based processing, is it? (Which makes me wonder if there are any languages out there which _both_ have the [noun] [adjective] word order, like french, and the [subject] [verb] order, like japanese...))).

However, suppose that japanese native speakers really were predisposed for stack-based languages. Doesn't that make for a delicious alternative-history idea, where instead of a Fifth Generation Computer initiative, we had the FORTH Generation, and the western world found itself unable to compete due to a fundamental linguistic disadvantage? I suppose the only way to counter that menace would have been to push Lisp Machines, to exploit the corresponding japanese inability to handle prefix...

One may dream.

Vilhelm


IbaDaiRon:

(Which makes me wonder if there are any languages out there which _both_ have the [noun] [adjective] word order, like french, and the [subject] [verb] order, like japanese...))).

Wikipedia (Subject Object Verb) says:

Among natural languages, SOV is the most common type. The SOV languages include Armenian,Turkish, Japanese, Korean, Manchu, Mongolian, Ainu, Nivkh, Yukaghir, Itelmen, Persian, Pashto, Kurdish, Burushaski, Basque, Latin, Bengali, Burmese, Tibetan, Amharic, Tigrinya, Abkhaz, Abaza, Adyghe, Avar, Kabardian, Sumerian, Akkadian, Elamite, Hittite, Hindi, Navajo, Hopi, Aymara, Quechua, Pāli, Nepali, Sinhalese and most other Indian languages.

...

Within Eurasia SOV languages often (but not always, e.g. not ordinarily in Persian) place adjectives before the nouns they modify, and this is often cited as a universal tendency of SOV languages; however, outside Eurasia SOV languages usually place adjectives after the modified noun.

Persian and Latin (to an extent) seem to fit the bill, for starters.

(Why am I suddenly reminded of Gov. Ishihara and how bad French people are a math?! :)


IbaDaiRon:

(AT math.)

(Or should that be maths?)

;)


Anonymous:

Hehe, I had to google to see what that was a reference to, but yes, obviously the word order for adjectives must be the underlying problem -- completely incompatible with normal functional notation! :)

Vilhelm


Anonymous:

Very interesting post. I'd never heard of any of the Japanese programming languages.

Hope life is treating you well...

Heather

Comment season is closed.