[comp.lang.misc] Programs from other countries.

connors@druco.ATT.COM (ConnorsPA) (06/13/90)

	Some of us were sitting around here in one of
	our rare idle moments, and we got to thinking.

	Here all we see are thousands and thousands of programs
	written in ENGLISH. But there are many other countries
	around the world, and many nationalities.

	What do programs look like in other languages?
	Are the keywords still in English, with the comments
	in the native language? Or does everything look different?

	It would be very interesting to see some short samples
	of code in other languages.

-----------------------------
 Paul Connors
 Email:	att!druco!connors
-----------------------------

abrodnik@watdragon.waterloo.edu (Andrej Brodnik (Andy)) (06/13/90)

In article <4896@druco.ATT.COM> connors@druco.ATT.COM (ConnorsPA) writes:
>
>	What do programs look like in other languages?
>	Are the keywords still in English, with the comments
>	in the native language? Or does everything look different?
>

Hi, 

my mother's tongue is Slovene and from my experience I have to say that
programmes written by Slovenes are more or less a kind of mixture of English
reserved words (begin, end, ...), and Slovene comments and names of variables
or procedures etc. For example let me write a short programme in English and
in Slovene:

  PROGRAM Something;
  VAR counter: integer; 
  BEGIN
    FOR counter:= 0 TO 10 DO WriteLn ('Hi there!');
  END;  (* Something *)

  PROGRAM Nekaj;
  VAR stevec: integer; 
  BEGIN
    FOR stevec:= 0 TO 10 DO WriteLn ('@ivijo !');
  END;  (* Nekaj *)

Here you can note one problem. In Slovene alphabet we have some letters which
do not exist in English one. Therefore, according to ISO standard, we use
ASCII codes of "^[@~{`" for them (and they appear on our terminals/printers in
                                                                   v  
their Slovene shape). For example "@" would appear something like "Z" (only
its height is the same as any other's letter. 

But in common compilers these characters are reserved for special purpose
opeartors and therefore they can not appear in variables/procedures names. In
                                    v
fact "stevec" should be written as "stevec", but in strings to be printed out
you can freely use the Slovene characters. 

To conclude, the programmes have English reserved words, Slovene
variable/procedure names (not completley written in Slovene alphabet) and
completley Slovene strings.

I hope that this answeres your question, but if you have any further questions
do not hesitate to ask. I can tell you even how the programmes look like
written using a Russian alphabet. For all "not-Cyrilic" people they could be
realy strange, but more or less everything depends and is defined through the
definition of Ord(char) function. 

Regards

Andrej

diamond@tkou02.enet.dec.com (diamond@tkovoa) (06/14/90)

In article <4896@druco.ATT.COM> connors@druco.ATT.COM (ConnorsPA) writes:

>	What do programs look like in other languages?
>	Are the keywords still in English, with the comments
>	in the native language?

Usually.  ISO standards usually specify the language syntax but not
the contents of comments.  Programs are usually portable from one
country to another.

I have seen one exception.  In C for System V (or at least some variants),
identifiers can use non-Roman characters.  It's a bit tough to remember
that some of those kanji are variable names and not comments.

-- 
Norman Diamond, Nihon DEC     diamond@tkou02.enet.dec.com
Proposed group comp.networks.load-reduction:  send your "yes" vote to /dev/null.

jensting@skinfaxe.diku.dk (Jens Tingleff) (06/14/90)

connors@druco.ATT.COM (ConnorsPA) writes:

[..]

>	What do programs look like in other languages?
>	Are the keywords still in English, with the comments
>	in the native language? Or does everything look different?

I've noted from German computer-hobbyist magazines (hey, let's design
a 68020 based computer..) that a lot of these germans *like* their programs in
german. Most of them make do with keeping all the identifiers in german,
plus comments. Some code in English entirely. (As a digression, I code in
English, but I have `international amibitions'.)

I have even seen an ad for a Pascal compiler that allowed you to switch
keywords, so that you could have german language keywords in Pascal.
*VERY WEIRD*, IMHO.

In Denmark, I've seen a lot of programmers in acedemical environments code
in danish, and a lot of people code in English.

I don't think there is a general trend, at least not in the countries I've
seen sample code from (Denmark, Germany,..)

	Jens

jensting@diku.dk is
Jens Tingleff MSc EE, Research Assistent at DIKU
	Institute of Computer Science, Copenhagen University
Snail mail: DIKU Universitetsparken 1 DK2100 KBH O

sergio@squid.rtech.com (Sergio Aponte) (06/15/90)

>In article <4896@druco.ATT.COM> connors@druco.ATT.COM (ConnorsPA) writes:
>
>>	What do programs look like in other languages?
>>	Are the keywords still in English, with the comments
>>	in the native language?
>

	I received some scripts and configuration files from Germany for an
	Apollo, and even when they wre in csh, the use of variable names
	in german, or node names for the NET in german made them very hard
	to read. Comments were in german two, so it was very hard to
	decifer what was done at many points of the script.

	Found them very interesting, do...
-------------------------------------------------------------------------------
| Internet: sergio@squid.ingres.com      Sergio L. Aponte, MTS @ Ingres Corp. |
| UUCP    : {sun,mtxinu,pyramid,pacbell,hoptoad,amdahl}!ingres!squid!sergio   |
-------------------------------------------------------------------------------

ck@voa3.UUCP (Chris Kern) (06/15/90)

Fellow at Xerox hacked their Mesa compiler a couple of years ago
to accommodate multilingual (i.e., several languages simultaneously,
not just a single language other than English) source programs.

Compiler keywords were still in English, but module names, identifiers,
string literals and comments could be in any language or combination
of languages.

So, for example, you could use Chinese characters for constants,
put your variable names in Russian, and document your program with
Arabic comments (reading from right to left, of course), perhaps
containing German parentheticals (reading from left to right).

The source code could include different font styles (e.g., italics)
and even graphics (e.g., to diagram data structures).

-- 
Chris Kern			     Voice of America, Washington, D.C.
...uunet!voa3!ck					+1 202-619-2020

major@pyrmania.oz (Major) (06/15/90)

connors@druco.ATT.COM (ConnorsPA) writes:


>	What do programs look like in other languages?
>	Are the keywords still in English, with the comments
>	in the native language? Or does everything look different?

Some years ago, I went to a seminar given by someone from the USSR
accademy of sciences. He said that they wrote their own compilers
which took russian keywords. He said the FORTRAN compiler was
easy because there were few keywords and the result was not expected
to be directly readable. COBOL was more difficult as the result
was supposed to end up looking like Russian (not english) sentences.

----
Happy Hacking!		| US immigration official to little old lady: Do you
Major			| support the overthrow of the government by violence
			| or subversion? Lady: (long pause) Violence I think

karl@haddock.ima.isc.com (Karl Heuer) (06/17/90)

In article <5454@rtech.Ingres.COM> sergio@squid.UUCP (Sergio Aponte) writes:
>I received some scripts and configuration files from Germany ...
>Comments were in german two, ...

German Two?  Would that be the new ANSI Standard German?  I didn't think it
had been approved yet, but maybe this was based on a Draft copy.  In the first
public review, I submitted a proposal to eliminate noun genders, but the
Committee insisted on retaining them for backward compatibility with German
One, and occasionally to disambiguate (das Messer vs. der Messer).

Karl W. Z. Heuer (karl@kelp.ima.isc.com or harvard!ima!karl), The Walking Lint
:-)