Slashdot Mirror


JavaScript For the Rest of Us

First time accepted submitter my2iu writes "The JavaScript programming language is both widely available and very powerful. Unfortunately, since only 6% of the world's population are native English speakers, the other 94% of the world are forced to learn English before they can start using JavaScript. Babylscript is an open source project that aims to translate JavaScript to all the world's languages, including French, Spanish, Chinese, and Arabic. The project has recently completed its 12th translation, enough so that the native languages of over 50% of the world's population are now supported!"

51 of 285 comments (clear)

  1. VBA? by Anonymous Coward · · Score: 5, Insightful

    Because having local-language versions worked out so well for VBA - and that isn't even on the internet.

    1. Re:VBA? by multicoregeneral · · Score: 4, Insightful

      I don't see what the problem is. Outside of the US, most anyone in business speaks english anyway. If you're educated, anywhere, you speak english. Most every programming language is in english. It's a misstatement to say that 94% of the world doesn't speak english. It's factually incorrect. It doesn't actually matter what the language they speak is. Foreign born programmers can look up the docs like anyone else when they don't know what a function does. This project is neat, because it's technical, and nobody actually needs it (as every fun project should be). But I see it as causing a more complex problem than the one it's trying to solve. Amazed it's still running though...

      --
      This signature intentionally left blank.
    2. Re:VBA? by savuporo · · Score: 4, Interesting

      >>If you're educated, anywhere, you speak english
      You should go visit Japan and Korea. EVERYTHING technical is done in local languages. Good english speakers are actually very hard to find even in top technical teams.
      I suspect the same is the case in mainland china, although i have no first hand experience ( in Taiwan and Hong Kong english is everywhere )

      --
      http://validator.w3.org/check?uri=http%3A%2F%2Fwww.slashdot.org Errors found while checking this document as HTML5!
    3. Re:VBA? by multicoregeneral · · Score: 3, Insightful

      Never been to Korea, but I have been to Hong Kong, Israel, and India. To the best of my knowledge, it's never been a problem in any of those places. The problem with a project like this is that the nature of code is international to begin with. And support across the board sucks as it is. You have to write different code like they're proposing, your support is going to waver, and you're going to have an internationally fragmented Javascript unless everyone adopts some variation of their engine (unless they're running a moore machine to convert it back to mainline js. Ref website isn't clear at a glance).

      --
      This signature intentionally left blank.
    4. Re:VBA? by Rei · · Score: 5, Interesting

      Even here in Iceland where everyone is quite fluent in English (much moreso than in Japan), technical terms still are often handled in Icelandic. Aka, if you read the news about the Higgs announcement, it's not the "Higgs Boson", but "Higgs Bóseindin". It's not "centripetal force", but "miðflóttaafl". It's not "electromagnetic radiation", but "rafsegulbylgjir". Yeah, people sometimes use the English terms too (even for common words, some English words have become pretty much embedded in the language unfortunately), but in general, Iceland strives to avoid that. Even words for new products - computer is "tölva (number-prophet), phone is sími (old word for "line"), etc. The other Nordic languages don't do this sort of thing nearly as much.

      --
      "/etc/rc.d/rc.sysinit is a gimp plugin and must be run by the gimp in order to be used."
    5. Re:VBA? by VGPowerlord · · Score: 4, Funny

      2 tonnes = 4409.24 pounds.

      So, 2 tonnes is $6,927.02 at today's exchange rates?

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    6. Re:VBA? by just_a_monkey · · Score: 2

      I'm using "rafsegulbylgjir" for EM-radiation from now on.

      --
      How inappropriate to call this planet Earth, when clearly it is Ocean.
    7. Re:VBA? by ericloewe · · Score: 2

      I haven't seen a Klingon manual for C++ yet

    8. Re:VBA? by Optic7 · · Score: 3, Insightful

      Hmmm... there's a simpler explanation for why French uses many similar words as English: I've heard it said that English is about 60% derived from French. It's really remarkable how many same/similar words between the two languages. The roots of English would explain why there's so many similarities. Instead of the French using English words, it's much more likely that it's the other way around. While on the other hand, Icelandic has probably close to 0% French origins.

    9. Re:VBA? by Invisible+Agent · · Score: 3, Funny

      Actually, Knuth's "The Art of Computer Programming" reads much better in the original Klingon.

      --

      Invisible Agent
      This post is a mirror; when a monkey stares in, no hacker gazes out.
    10. Re:VBA? by Schmorgluck · · Score: 2

      While I agree with your point, your examples are hilarously irrelevant. Almost all of them are instances of English borrowing from French.

      It's a consequence of roughly 80% of the English lexicon being of Romance origin, a large part of it through French (which brought also the words based on ancient Greek, lile politics and economy).

      As a side note, in your last example, the Icelandic (TH)ú looks a lot like a cognate to the deprecated English "thee", but IANALinguist.

      Better examples of English loanwords in French are "week-end", "parking" (for a parking lot), "design" (in its specific meaning of designing shapes), freezer and so on.

      --
      There's nothing like $HOME
    11. Re:VBA? by Rei · · Score: 2

      Almost all of them are instances of English borrowing from French.

      To be fair, my first example was "téléphone" :) And anyway, it gets hard with words that branched earlier to say who borrowed from who, as both languages have diverged from the branching point. But a couple of those words do not look like they follow traditional French naming conventions and instead look more like English naming conventions, suggesting a later borrowing.

      As a side note, in your last example, the Icelandic (TH)ú looks a lot like a cognate [wikipedia.org] to the deprecated English "thee", but IANALinguist.

      Icelandic is a north germanic language, while English is primarily a hybrid west germanic / old french language. So they both have a strong connection in proto-germanic. Icelandic then re-intersected English during the viking raids - most of the early settlers to Iceland came not from Norway, but from viking colonies in the British Isles. Icelandic then turned into sort a living time capsule due to a combination of a strong writing tradition and the island's isolation. The language has changed, but not as much as most languages have during that time period, so a lot of aspects of it are reminiscent of older European languages.

      The declension of personal non-possessive pronouns goes:

      I: Ég Mig Mér Mín
      You (s): (TH)ú (TH)ig (TH)ér (TH)ín
      He: Hann Hann Honum Hans
      She: Hún Hana Henni Hennar
      It: (TH)að (TH)að (TH)ví (TH)ess
      We: Við Okkur Okkur Okkar
      You (pl): (TH)ið Ykkur Ykkur Ykkar
      They (m): (TH)eir (TH)á (TH)eim (TH)eirra
      They (f): (TH)ær (TH)ær (TH)eim (TH)eirra
      They (n): (TH)au (TH)au (TH)eim (TH)eirra

      Notes:
        * Trailing consonants are soft, almost disappearing. So, for example, "Mig" sounds almost like "Me" and (TH)ig like "Thee" (unvoiced th, though). (TH)á is said like "Thou" (again, unvoiced th).
        * au isn't like the german - it's really "öi". "ö" is like the german, or kind of like the u in the English word "fur" said with rounded lips.

      I won't go into possessives because they get a lot more complicated, lol!

        You learn a lot of interesting history as you learn the language. For example, it's a little shocking when you hear for the first time, say, little old ladies saying that they need to go to "pissa" (pee) - said just like "piss" with an a at the end. "Skíta" (related to the word "shit") is also a casual term. Well, the reason for this is that when French intersected English, the new imported terms were seen as the "polite" way to talk about such things, and the old terms became seen as dirty or profane.

      --
      "/etc/rc.d/rc.sysinit is a gimp plugin and must be run by the gimp in order to be used."
  2. And this is different...??? by Grashnak · · Score: 5, Insightful

    How is this different than every other programming language I've ever encountered? And doesn't writing javascript in, say, Arabic, just make it inaccessible to 99% of the people who like look at your code?

    --
    Life needs more saving throws.
    1. Re:And this is different...??? by fuzzyfuzzyfungus · · Score: 4, Insightful

      I'm pretty sure that, aside from its dependence on Latin characters(which is, all in all, a good thing, Unicode would probably allow it to achieve malign sentience), TECO has no basis whatsoever in any human language.

      GZ0J\UNQN"E 40UN ' BUH BUV HK
        QN
        QQ/10UT QH+QT+48UW QW-58"E 48UW %V ' QV"N QV^T ' QWUV QQ-(QT*10)UH >
        QV^T @^A/ /HKEX$$

    2. Re:And this is different...??? by jginspace · · Score: 3, Interesting

      And doesn't writing javascript in, say, Arabic, just make it inaccessible to 99% of the people who like look at your code?

      Yeah - it'll be interesting to find out what the LibreJS people think about it: https://www.gnu.org/software/librejs/

    3. Re:And this is different...??? by marcello_dl · · Score: 5, Interesting

      IIRC applescript had localized versions. There wasn't a problem in reading foreign scripts because keywords were translated (at one point keyword must be recognizable to the interpreter, that makes it relatively easy to translate them.

      It is still not a good idea, of course. You need to copypaste a script from a blog and have it translated by the interpreter before understanding it.

      And as a foreigner I can attest that the translation of keywords is a non-existent problem. Either you know the syntax of the whole command (parentheses, colons, semicolons, tabs, whatever) or you look it up. Once you have memorized it, could be english, your tongue, or LOLCODE, doesn't matter.

      I'd possibly endorse localized versions of Logo and Smalltalk for basic teaching to kids. Everything else is overkill.

      --
      ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
    4. Re:And this is different...??? by littlebigbot · · Score: 2

      At least learning English is useful outside using JavaScript, whereas that is an exercise in masochism.

    5. Re:And this is different...??? by fuzzyfuzzyfungus · · Score: 2

      But learning TECO allows you to write a brainfuck interpreter and get into a state where writing in brainfuck feels like a blessing at the same time!

    6. Re:And this is different...??? by UnknownSoldier · · Score: 5, Insightful

      > I see this as an interesting idea. Why should I write "if" instead of "jos" (i.e. Finnish)? The latter is easier for Finns to understand and learn, especially if they are very young (or very old).

      Except this idea was designed by people who have no clue how interpreters/compilers do their parsing.

      So now I have to add *all possible potential translation words* as reserved for identifiers??

      Using your Finnish example...

      "English";
      var jos = 1; // OK, jos is not a reserved word IN English
      if( jos ) console.log( "jos = " + jos );

      "Finnish";
      var jos = 1; // FAIL, jos is reserved as 'if' in Finnish
      jos( jos ) console.log( "jos = " + jos ); // ERROR: AMBIGUOUS

    7. Re:And this is different...??? by cryptizard · · Score: 2

      Except not really? You just have a preprocessor step where you specify which language you coded it in and everything is translated to some canonical form. You could even do this in everyone's precious favorite language C using macros.

    8. Re:And this is different...??? by bzipitidoo · · Score: 2

      Pascal was once a popular programming language. I've always felt one of the reasons C beat out Pascal is English, but maybe not. In Pascal a block is delimited with BEGIN and END, in C it's { and }. Pascal uses IF THEN and ELSE, C uses "if" and "else" but not "then", and these can be avoided with the ? : operator. C uses "for", Pascal uses FOR and TO (or DOWNTO). Pascal unnecessarily adds two more keywords with this REPEAT UNTIL structure, C gets by with one more keyword with "do while". In Pascal, have to actually use the English words FUNCTION or PROCEDURE (and the distinction between the 2 is petty), in C it's all functions and all you do is add () to the end of an identifier. The C syntax is shorter, cleaner, and more neutral.

      Most current languages borrow syntax heavily from C, and Javascript is no exception. Though, it seems the Javascript designers must have liked Pascal. Why else would they use "function" and "var"? Still, it's not that many English words, maybe about 20? I do not see that this Javascript translation effort is solving a real problem.

      --
      Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
    9. Re:And this is different...??? by shutdown+-p+now · · Score: 3, Insightful

      And as a foreigner I can attest that the translation of keywords is a non-existent problem.

      As another foreigner, I can second that. I didn't know English when I started coding. I actually learned the basics by coding, and reading the docs. Similar ideas were floated then and some were actually implemented, and every time they were tried they were found to be an epic fail in practice, and most programmers (even those who didn't speak English beyond keywords in their favorite language) laughed at them.

  3. sounds like a bad idea by OleMoudi · · Score: 4, Interesting

    Considering current situation with XSS prevalence, javascript obfuscation techniques and content filters bypassing, this will only make matters worse

    --
    ---------
    Thinking never hurt anybody --MacGyver
  4. Forced to learn English to learn Javascript?! by bool2 · · Score: 5, Insightful

    Javascript keywords are English words but it's quite a leap to suggest you need to know English to learn Javascript! In fact, it might be an advantage to have the keywords as foreign words because they represent abstract concepts that ought to be considered apart from their real world meanings. IMHO.

    1. Re:Forced to learn English to learn Javascript?! by dargaud · · Score: 5, Interesting

      Exactly. I learned programming in France, at a time when there were some (rather bad) national programming languages like LSE where the words seemed too grounded and loaded with double meanings. Also there were several translated versions of Basic. Some commands were much longer to type, some others didn't translate directly and the equivalent was unintuitive at best, and finally you couldn't type listings found in programming magazines.

      --
      Non-Linux Penguins ?
    2. Re:Forced to learn English to learn Javascript?! by fuzzyfuzzyfungus · · Score: 4, Funny

      Luckily, all human languages are isomorphic, so we can just draw up an unambiguous list of localized equivalents to each keyword, allow automated localization of javascript code without any possible ambiguity! What could possibly go wrong or undermine this glorious scheme?

      (Other than comments, variable names, and the fact that languages are far from isomorphic?)

  5. No by Anonymous Coward · · Score: 5, Insightful

    The programming language is the language, not the english language. You need to learn keywords, they could be klingon, do not need to make any sense for you. On the other hand, documentations are usually written in english.

    1. Re:No by Rei · · Score: 3, Funny

      You need to learn keywords, they could be klingon, do not need to make any sense for you.

      Nonsense. "(car (cddr (cadr (car x))))" is a perfectly understandable English sentence.

      --
      "/etc/rc.d/rc.sysinit is a gimp plugin and must be run by the gimp in order to be used."
    2. Re:No by medv4380 · · Score: 2

      Which character encoding should I use to make a Klingon based programming language?

  6. Oh non ... by Anonymous Coward · · Score: 2, Funny

    C'est pas vrai!

  7. Nonsense by fragfoo · · Score: 3, Informative

    Someone pulled this idea out of his ass and thought it was a genius idea.

    --
    Sig? Heil
  8. Language keywords with accents? by Rhaban · · Score: 2

    I just took a look at the french translation:

    charAt carÀ
        charCodeAt codeCarÀ
        indexOf indiceDe
        lastIndexOf dernierIndiceDe
        split fendre
        substring souschaîne

    I foresee thousands of text encoding bugs appearing everywhere this is used.

  9. Re:Language keywords with accents? by HarrySquatter · · Score: 2

    Such as wondrous Slashdot which still sucks at Unicode...

  10. Misguided by Bogtha · · Score: 4, Insightful

    Unlike other multilingual programming languages, Babylscript allows people to write programs in a mix of different languages. A programmer can take a library written in French, mix it with their own program written in Spanish, and use code snippets they found on a Chinese help forum.

    I would hazard a guess and say that it's easier for a non-English speaker to learn normal JavaScript than it is for anybody to deal with this kind of nonsense.

    I don't really see the advantage in this. You would be deliberately segregating yourself from the wider development community, and for what? Anglophones have to learn a lot of this stuff too. An asterisk doesn't mean multiplication to us, yet we learn that. Double ampersands don't mean "and", yet we learn that. Parentheses don't mean "do something", yet we learn that. The equals sign means "equals" in English, yet it's the assignment operator in JavaScript.

    There are languages which are designed to more closely match natural language. AppleScript and Basic, for instance. There care also language which aren't very readable at all in English, such as LISP or Perl, that are still very successful. Natural language isn't really valued in the programming world for a variety of reasons. Sure, function calls might have some correspondence with English, but in the end, they are labels, not sentences, and everybody needs to learn what the labels mean precisely, even English people.

    --
    Bogtha Bogtha Bogtha
    1. Re:Misguided by phayes · · Score: 3, Interesting

      Perl hard to read? I beg to differ!
      http://www.perlmonks.org/?node_id=963133

      --
      Democracy is a sheep and two wolves deciding what to have for lunch. Freedom is a well armed sheep contesting the issue
    2. Re:Misguided by Hentes · · Score: 2

      I write my code in English so that everyone in the world can understand my source. Digging through a library written in French would be much worse than learning the meaning of a few words (that have little to do with their English meaning anyway).

  11. Who came up with these awful translations? by psychonaut · · Score: 3, Insightful

    The translations look terribly inconsistent and even completely erroneous. The German one, for example, strangely mixes verb forms: "throw" is "wirf" (informal imperative) but "catch" is "fangen" (infinitive). "char" is translated as "aeichen", which isn't even a word in German. Are the "translators" just people with no knowledge of the target language who are simply looking up words in a dictionary? If so I don't see how this project is possibly going to be of use to anyone.

    1. Re:Who came up with these awful translations? by pne · · Score: 2

      the A and Z keys are next to each other (on a German keyboard as well as an international one).

      They're nowhere near one another on a German keyboard; the key below A is Y, and Z is next to T. Perhaps you were thinking of the French keyboard (AZERTY)?

      --
      Esli epei etot cumprenan, shris soa Sfaha.
  12. This will not end well by phayes · · Score: 2

    Decades back I used a research OS that was developed pretty much along UNIX lines except that it was written in this Pascal variant where all the keywords were in French (Pascal was popular back then as a first language). It never achieved any traction & disappeared because neither the OS nor the language proposed anything really useful that you couldn't get already from Unix/C or just plain Pascal.

    On a more recent level, one of the biggest PITA I and many others have with Office in non-english locales is that they translate the function names.
    =sum(a1:a6) becomes =somme(a1:a6). I'ts easy enough to find websites that will help perform actions in Office, but I often spend twice the time finding out lust what wierd name MS has come up with for some VB function.

    Is "pour" so much better than "for" for someone who is not a native english speaker? No, as by the time you have become proficient in the computer language, the subset of a foreign tongue it uses become well known & the difference irrelevant.

    It looks to me that Babylscript is just a tool for the language bigots out there. Give it a few months & people will have forgotten it.

    --
    Democracy is a sheep and two wolves deciding what to have for lunch. Freedom is a well armed sheep contesting the issue
  13. STOP! by fredprado · · Score: 3, Insightful

    For god's sake! Please lets stop translating computer languages.

  14. Re:Bad math, bad premise by Grave · · Score: 2

    I've always hated the argument that English is not the most widely spoken language because of "native" speakers. It is the most common second language that is learned throughout the world. And honestly, is the idea of having a single language that can be understood across the world so bad?

    I'm all for translating documentation into a native language for more people to learn, but the programming language itself needs to be consistent across all uses. Otherwise, it's not the same programming language--just a copy cat with similar structure and syntax, but not very easily followed by someone who knows the original.

  15. Idiocy by pinkeen · · Score: 4, Insightful

    This is the most idiotic idea I've ever saw.

    Will they also translate all the libs, the docs, the books out there?
    IMHO This makes JS even less accessible and seriously increases the confusion factor.

  16. Bloody good idea, chaps. by Higgs+Bosun · · Score: 2

    Finally use English programmers change the appearance of GUI widgets by their colour property!

    This might be a bit imperialistic, but is a programmer who is not comfortable with English a good programmer? Since there is so much technical info in English, if your English skill aren't they good then you are going to miss out on a lot of good info. I seem to recall an interview with Linus Torvalds where he said that because all source code, etc, he ever saw was in English it never even occurred to him to code in his native language. Someone who wants JavaScript in their native tongue has probably only just picked up "Learn JavaScript in 24 hours"...two hours ago.

  17. Re:Bad math, bad premise by Lunix+Nutcase · · Score: 2

    English is also the language in which most of the computer-related neologisms originated. Leaving the terms in English makes them unambiguous whereas translating them has constantly been shown to do nothing but confuse people. This guy probably things he originated the idea of translating computer programming languages, but this has been done before many times and all such efforts have pretty much died out and for good reason: they suck.

  18. Javascript was better ... by Infernal+Device · · Score: 4, Funny

    in the original Klingon.

    --
    "My God...it's full of trolls!"
  19. Re:Really? by wjousts · · Score: 3, Informative

    I work for a Swiss company. Our official internal language is also English.

  20. OffShore Programming by heatseeker_around · · Score: 2

    I can't wait to see the result of the code for the project that my company decided to develop offshore, in India. I am sure that our clients will be pleased to learn that we will not be able to debug a fucking line of code on site.
    What a fucking great idea ! yeah !

    Why don't you just write it in our beloved Universal Language "Esperanto" ? It should be even easier to maintain... It is UNIVERSAL !....

    I believe that sometimes, if nobody invented a specific thing, maybe it's because this thing is fucking stupid. Try it, figure out by yourself that it is so stupid that even your mother would disown you, then trash it forever.

  21. Re:Too hard to learn a few keywords? by DriveDog · · Score: 2

    I'd go even further. When first learning to program, I was thrown more than once by thinking that a keyword meant something like its English definition would suggest. I would have learned quicker had the keywords been randomly selected from Dr. Seuss books.

  22. Not the first language to have this done to it by roman_mir · · Score: 2

    This is not the first time somebody does this either, there is an entire industry in Russia built around a business platform (1 s) that prides itself by the fact that they have translated BASIC into Russian, I shit you not.

  23. Bad Translation in German and some other issues by Qbertino · · Score: 2

    The German translation isn't good. They could've easyly improved on the syntax. let ist translated into 'sein' (to be) rather than 'lasse' (let). There are a few other instances were they could've actually improved on the language as a whole but messed it up.

    Besides, as others have pointed out: The PL being in a different language than the native is an *advantage*. Less mixing of words. It's great to have native Variables and english keywords - it gives you way more flexiblity with your code.

    My 2 cents.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:Bad Translation in German and some other issues by Cow+Jones · · Score: 2

      Exactly. The German translation is horrible. It looks like one person just went over the keywords and translated them without considering the context they'd be used in. I'm pretty sure that nobody else checked on that translation before they decided to go with it.

      The main problem seems to be that the translator decided to use the infinitive verb form for command/method names, when the imperative form would have been more appropriate.
      E.g., arr.zerteilen(x) literally means arr.to_slice(x), not arr.slice(x).

      They're not even consistent in that usage:
      decodeURI --> dekodiereURI (imperative)
      break --> abbrechen (infinitive, "to break")
      try --> versuche (imperative)
      throw --> wirf (imperative)
      catch --> fangen (infinitive, "to catch")

      Some translations are incorrect or just plain weird:
      length --> länger ("longer")
      parseFloat --> parseGleitkommazahl ("parse" is not a German word)
      parseInt --> praseGanzzahl (neither is "prase", obviously ;-)
      return --> rücksprung ("the jump back", awkward when used with values)
      escape --> umsetzen (??)

      This clearly needs more work. Which is a shame, because I'm teaching programming to an 11-year old who only has a rudimentary grasp of English. This could have been used as a stepping stone to the real thing, but not in this state. It's probably a good thing, anyway. It won't hurt the kid to learn some more English.

      CJ

      --

      Ah, arrogance and stupidity, all in the same package. How efficient of you. -- Londo Mollari