caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Internationalizing the language
@ 1999-10-29 13:14 Benoit de Boursetty
  1999-10-30  0:45 ` Benoit de Boursetty
  0 siblings, 1 reply; 2+ messages in thread
From: Benoit de Boursetty @ 1999-10-29 13:14 UTC (permalink / raw)
  To: caml-list

	Hi,

	Thanks 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îne.ml?" describing a module Chaîne, 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" ?



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Internationalizing the language
  1999-10-29 13:14 Internationalizing the language Benoit de Boursetty
@ 1999-10-30  0:45 ` Benoit de Boursetty
  0 siblings, 0 replies; 2+ messages in thread
From: Benoit de Boursetty @ 1999-10-30  0:45 UTC (permalink / raw)
  To: caml-list

A quick comment on one my previous post, that somewhat moderates my
ardour:

> * 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.

I wasn't thinking that during such a translation, collisions are likely to
occur between identifiers and keywords (identifiers that aren't keywords
in the first language syntax become so in the second one). You run into
problems then. My apologies for having made such a peremptory statement.

BdB.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-11-03 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-29 13:14 Internationalizing the language Benoit de Boursetty
1999-10-30  0:45 ` Benoit de Boursetty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).