Programming Languages of Faraway Lands

I have been wondering about this for quite some time.
In Spain when a programmer wants to write a simple program in BASIC do they use their own language? Example:

Or do those Spaniard programmers use the English commands? Of course I want this question to be all inclusive with languages like Chinese, Russian and programming languages like C and Pascal and so on and so on and soforth.

The chinese programmers I’ve dealt with programmed in the same C that we do.

It would be fairly easy to write a preprocessor that would do all the translation for them, so they COULD write in their own language, but they don’t. I’d guess that 99% of foreign programming is done in english, and perhaps much more.

Well, there’s no right answer to your question. It’s up to the interpreter/compiler maker.

One could always make a BASIC interpreter that used keywords more appropriate to a speaker’s native language. One could always make a C++ compiler in the same way.

However, this would make porting code to another variation on the same language somewhat difficult. An English-BASIC interpreter wouldn’t be able to understand a Spanish-BASIC program in textual form. They would effectively be separate languages. It would impede the ability for software developers to understand one another’s code too.

The interpreter/compiler could be made elaborate enough to accept the various variations on the language, of course, and even possibly translate betwen them. But there’d always be some language left out, and it’d be a huge pile of extra work to support this.

But this wasn’t a question about whether or not it’s a good idea. It probably isn’t. The question though is whether it’s done.

In general, I’d have to say no. English seems to be a pretty common basic ground for a lot of programming languages, though I don’t doubt some have roots in other languages. However, from my experience, interpreter/compiler makers don’t generally overhaul their language keywords for the purpose of being multilingual. Whatever the human language basis of the programming language is probably how the language stays. The programming language is, itself, a language, and people wanting to ‘speak’ in it have to learn the words and grammar.

Of course, while I’ve been doing this stuff for over a decade, I haven’t had the widest exposure to the vast network of programming languages, but my guess is its more trouble than its worth. :slight_smile:

One reason it would be a very bad idea is that it would change the sets of reserved keywords in languages which rely on them, which is most general purpose programming languages in wide use. For example, as an “English” programmer, I might decide to use “wenn” for a variable name for some reason, and my program would no longer compile in “German” because reserved keyword “if” has now become “wenn”.

I remember back when I had my Commodore 128 there was a hack to make Microsoft Basic (you know, the command-line, built-in basic) use German instead of English. Trading programs wasn’t difficult either, since the language was tokenized. That is, you type in PRINT “HELLO” and PRINT got converted to a token that the interpreter recognized as meaning “print.” The hack got the parser to recognize German and tokenize it accordingly. Since programs weren’t saved as text but as binaries, the same tokens would reflect proper BASIC when loaded onto another program. Boy, those were the days!

I should add that I meant that it would no longer compile in “German” even after a mechanical translation of the “English” keywords to the “German” keywords because of the conflict.

For those of you who can remember the damned things, C had “trigraphs” of course, which affected punctuation marks, not the language keywords. The rub was that Scandanavian keybords sometimes took away characters like ‘{’ to provide extra alphabetic characters. Trigraphs were two question marks followed by one of the remaining punctuation marks, to be interpreted by the compiler as one of the missing ones:

??=include <stdio.h>

main() ??<
       printf("hello world.");

Lovely, eh?

Oh hell, I should have said “printf(“hello world.??/n”);” to illustrate the lovely convention for the missing backslash, and illustrate that the stupid trigraphs had to be interpreted inside string literals, too.
Since they were typically done by the lexical scanner, many compilers would even pick them up in comments. I remember having problems because somebody who didn’t know about the convention hacked in some local auto-commenting convention for our code contained in the comments, and used “??” something to delimit it. When it got ported around to various compilers, one eventually handed out warnings right and left about “unrecognized trigraphs” in the comments.

One common story that gets circulated around in programming classes is that of the plight of an English-speaking programmer attending a software convention in a non English-speaking country having dificulties in conversing with the local programmers, until he hits upon the idea of conversing in English pseudo-code.

I have not encountered any programming language (with the exception of Excel macros) where the actual built-in keywords were translated.

It would be a very bad idea to translate a programming language mainly because of the risk of programmer-assigned identifiers becoming reserved words, but also because it would unnecessarily hinder international communication (e.g. discussing a piece of code in an Usenet newsgroup.)

The subset of English words used for built-in keywords of programming languages is actually very small (if then while until for select input read print etc. are common to a lot of programming languages) so it’s not really a lot to learn even if you don’t know much English otherwise.

What can be translated and often is:

  • the development environment (editor/debugger etc.)
  • identifiers such as variable/function/class names.

I work very frequently with programmers and source code from more than a dozen countries, on all 6 inhabited continents, and I’ve never in my life seen anything but program comments in non-English programming language. In fact, I’ve never even heard of it happening, but I suppose someone somewhere may have come up with a “native Chinese” compiler. It’s possible, but unknown to me.

I have seen FORTRAN from China written as English command words. I have also seen a FORTRAN compiler FROM GERMANY
with English command words. (Print instead of Dreck.)
But I have seen the help libraries in a variety of native languages.

I believe Software AG’s Natural/ADABAS has a profile option for the programmer to use German. Software AG is, or was, based in Germany.

Using Kanji characters in the language is a pain, however.

Shodan The Mainframe Dinosaur

It is worth noting that PASCAL was designed in Zurich by Niklaus Wirth, whose first language was German, and yet it is entirely English based.

One of my co-workers is French and he once used a francosized (is that a word?) version of BASIC, in the French equivalent of junior high I think. He said it was terrible because although the key words were translated they were often quite awkward and the word order still followed the vaguely English-like BASIC syntax.

A lot of the code I’ve seen written by non English speaking programmers has used English keywords, but non-English variable names. Very hard to follow.

Does this mean that Europeans have to drop the “u” in Colour?

I found it rather humorous. While in Ecuador I took a class in C. The keywords were all the same, but the comments were in Espanyol. The teacher, who worked as a programmer for one of the big banks on Amazonas would always correct the spelling in my comments.

I also brought a spanish language version of win3.1 and dos 5.0 on my laptop (tells you when it was). It was a hit. They used pirated US versions.

Another related. We recently got a piece of equipment with an HP computer. The computer was purchased in the UK and came with an EU keyboard – even though it had a built-in euro key, and was therefore, totally cool, it got tossed because the LHS shift key was smaller than US standard.