Internationalizing the language

From: Benoit de Boursetty (debourse@email.enst.fr)
Date: Fri Oct 29 1999 - 15:14:51 MET DST


Date: Fri, 29 Oct 1999 15:14:51 +0200 (MET DST)
From: Benoit de Boursetty <debourse@email.enst.fr>
To: caml-list@inria.fr
Subject: Internationalizing the language

=09Hi,

=09Thanks to all for your answers. I will reply to some of the
interesting points you raised. To demonstrate what I meant, I wrote a
quick and dirty parser for a French syntax with camlp4:
http://www.stud.enst.fr/~debourse/caml.html

* Having identifiers and syntactic keywords in different languages makes
  you feel the fundamental difference between them without having to
  colorize them in Emacs. Thus you're more aware of the syntactic
  structure, and the language is easier to learn.

I must agree on that one, Mr Weis! I am just *really* wondering what it's
like to program completely in the language you're best at, not being a
native English speaker.

This remark is void, however, if the pervasive library is used. For
instance, "raise" is not a keyword, it is a value defined in the standard
library ("true" and "false", on the other hand, are also values but are
parsed as keywords). Just to advocate the ability of localizing library
interfaces.

In a possible solution, there would be an "interface localization" file
"cha=EEne.ml?" describing a module Cha=EEne, equal to "String" in
functionality, and that would not require re-compilation.

* The language of keywords should not change, otherwise it would
  make international program exchanges difficult.

This remark is irrelevant: automatic translation is easy between different
syntaxes of the same language. It's just another pretty printing of the
abstract syntax tree.

* Parser rewriting is difficult

I was not really concerned with feasability in the first place. But
actually, for French (who, compared to Japanese, resembles English quite a
lot I must say), I could modify the parser with camlp4 in about 1 hour ;
and I'm no expert in language parsing. I've only had to make one syntactic
modification, because "downto" doesn't exist in French (or I don't know
the equivalent).

Now, the very existence of camlp4 shows that I'm not the only one that
wants to be able to choose my brand of syntactic sugar.

* There are translations for keywords in French and they are used in
  practice

(sorry if I'm getting too local)

For me, "in practice" would mean that I use it in the source code: but at
present, "in practice" only means in compilation courses, books and
in pseudo-code written at board by teachers. Now, why do they call that
"pseudo-code" when, with the power of O'CaML and keywords in the right
language, it could be real code?

Thanks for the translation of "pattern-matching", too :-)

I note that the two persons who gave me the translation are researchers in
computer languages. I think this word is quite not often used by
end-users.

Also, my question was not specially about "matching", but about the phrase
"to match an expression with a pattern". Indeed, I'm reading the book by
C. Queinnec, and I find out that he makes sentences such as "Le filtrage
compare un filtre à une expression...". So, the phrase should translate:
"comparer une expression à un motif" ?



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:28 MET