From: djohnson@cs.ucsd.edu (Darin Johnson)
Newsgroups: sci.lang.japan
Subject: Re: Japanese programming languages?
Date: 15 Dec 92 04:17:25 GMT
Organization: =CSE Dept., U.C. San Diego

In article <1992Dec14.202710.752@ifi.unizh.ch> mduerst@ifi.unizh.ch (Martin J. Duerst) writes:
>
>In article <42292@sdcc12.ucsd.edu>, djohnson@cs.ucsd.edu (Darin Johnson) writes:
>> I don't think natural langauage grammar and programming language
>> grammar are remotely related - even to English - except for keyword
>> names and the like.  The arrangement of a program is more related
>> to convenience, utility, etc, than whether or not the culture uses
>> SVO or SOV, etc.
>> 
>I thought so too until I really learned to speak (and think) in Japanese.
>Although it isn't really something conceptually difficult, it is a hard
>step to change the order of thinking when forming a sentence. If it is
>convenient then to have tokens in a programming language arranged more
>or less in the same sequence as we think them, that might as well be
>true for the Japanese.

>> That's because it is often simpler for the compiler to do it this
>> way. 
>The compiler shouldn't be a big argument with the current memory and
>everything.

I was speaking of early compilers, and why they were written that
way (ie, they were written pragmatically, rather than to make it
seem like English).  Obviously, a compiler designed today will not have
the same restrictions and could be a lot different.  Another giant
factor that determines syntax layout is that the syntax be a context
free language.

>> (what if you had to
>> skip forward a page just to know the name of the function you
>> were looking at?)

>That a traditional programm is easier to read for you that are used to
>English is not by chance.

Well, I always treat the function name in a definition as a "chapter title"
instead of a verb.  Even Japanese with SOV puts chapter titles first :-)

A traditional program is easy for me to read because I have done it
for a long time.  When I first started, it was very difficult precisely
because it was so very different from English.  You had to surround
constructs at the beginning *and* the end (similar to making inflections
on subject or object match the verb - more common in foreign languages
than English).  Things were arranged according to mathematics instead
of English ("a plus b" instead of "add a and b").  Since Japanese will
be just as familiar with modern mathematical notation

Studies have shown that the difficulty of learning a new language
for *beginning-programmers*  is very similar between a standard
C/Pascal language or something radically different like Smalltalk
or Forth.  What about the difference between C's "while() {}" and
its "do {} while()"?  You could argue that "while" is the verb
which would indicate that C has verb-last and verb-first at the
same time.

However, I think there is so little in common with natural language
that this line of reasoning is faulty.  If a function name or
operation is a "verb", then where do all the other parts of speach
fit in?  What do "begin-end", declarations, and other parts correspond
to in a natural language?  I'm sure you could contrive a language
that was supposed to be based upon ingrained Japanese language
concepts, but I think you would end up with something as badly
suited to programming as COBOL is (which was explicitly designed
to emulate English).

-- 
Darin Johnson
djohnson@ucsd.edu
    Where am I?  In the village...  What do you want?  Information...