RE: international language support
- Posted by freeplay at mailandnews.com Aug 16, 2001
- 1007 views
As I see it the technical problem is fact that the reserved words of the langauage (end, for, while etc.) could clash with identifier names that programmers might choose. A solution (although it's really ugly) is to have all the reserved words in a language prefixed with a special character so no such clash is possible. For the sake of argument lets assume that the ! character isn't used (does Euphoria use ! for anything? - I'd have to check to be sure). Now we just write our code to look like: !include get.e !function main() !sequence cmdline cmdline = command_line() !for i = 1 !to length(cmdline) !do !printf(1, "Arg %02d is [%s]\n", {i, cmdline[i]}) !end !for !return(wait_key()) !end !function !abort(main()) I told you it was ugly!!! Just to clear up any potential confusion I'm in no way proposing this as a serious solution - just looking at that code segment above makes me feel like I have motion sickness. It's more to illustrate that maybe reserved words of a language could be explicitly set apart from identifier names. Many languages require you to prefix identifer names when used in certain contents ($variable in UNIX shell and @variable in Perl) so I'm just taking this convention and applying it to the reserved words as opposed to the identifiers. The result is ugly and jarring - but maybe that's because we're used to something else - very subjective I guess. As a totally academic question in the code snippet above I left command_line and length untouched. As I see it length is a built in reserved word so should I have !length - I'd say it was a difficult (if academic) call. Perhaps this idea might not be so mad for an "internal" form though - hmmm. Regards, FP. >===== Original Message From John McAdam <johnmcadam at clix.pt> ===== > >I just get my mail once a day, so I will answer everybody all at once. > >Kat, I like the lang.ini idea. Probably easier than include lang.e >because the user wouldn't always have to remember to include >the lang.e file - it would just be automatically used by the interpreter. >However, I think it would take a lot of work for Rob to it. Perhaps the >substitution was done by the editor at the same time as syntax >coloring, perhaps in an internal representation? > >Igor, I am sure that you will agree with me that there are some >intelligent people in the world who don't speak english. Probably >quite a few in fact. People who would pay for the ability to write >computer programs in their native language. A world full of people. >A really big world full of people who want this. I think this would >be a truly enormous market and there is no competition. There is >no language that does this. > >Rolf, Just because all other languages are in english doesn't mean >that they have to be. > >Igor, I speak portuguese very well, but if am trying to figure out some >complicated algorithm I do it in english because it flows faster for me. >I think that new programmers will have an even more difficult time if >their language skills are not as good. It turns off their creativity and >their enthusiasm - things that we need. >I will download the red.ex tonight when the rates go down. > >Irv, Why do you need a different sort order, as well? I don't understand. > >FP, My idea would be that the preprocessor substitute the keywords >and save the new file in its english version as a regular .ex file. The original >file - in other language - could be written with another extension. ".pex" >or "fex" or "Rex" or something (portuguese, french, russsian). The english >version would be the one shared between programmers of different >languages and for this group. The number of keywords would only be >double. Hmm. Maybe more. Hmm. I see your point. > >Kat, The substitution list would be strict. Fim would only mean End. The >problem would be exchanging a library or program with someone who >had used a variable named fim (which they understood to mean "financial >integration marker" or whatever in their language). In order to continue >exchanging code we would not be able to use translations of keywords >from any language. There must be a simple way of getting around this. > > >Rolf, No need to write off the majority of creative people in the world. >No need to shackle their minds by limiting them with just one language >option. Kids do learn quick its true, but even some adults are intelligent. > >JOHN > > > > >