Babylscript - a multilingual language
Babylscript - a multilingual language
Written by Alex Armstrong   
Monday, 23 May 2011

Until now English has been the language of programming and non-English speaking programmers have had to put up with a situation that is far from ideal.  The Babylscript project now offers an alternative for JavaScript programmers.

What language would you like to program in?

No this isn't a Ruby v Perl v Java v ... argument.

Let's rephrase the question as "What natural language would you like to code in?".

If you have never thought about this problem then it is easy to predict that you are an English speaker. As computing mostly started out in the US and UK (with apologies to every other non-English speaking inventor of the computer, e.g. Konrad Zuse, Sergei Lebedev and so on) the dominant language used in computer programming has been English. Speakers of other languages just have to adapt to using words like "if" and "for".

There an argument that some programs at least would be better coded in the language of the country that the application is intended to be used in - not just literal strings but keywords as well. There is an even more persuasive argument that teaching a language is easier in the students own natural language.




Now you can use multilingual programming in JavaScript. The Babylscript project has taken the Rhino engine and added the ability to code in almost any language you care to add a translation mapping for. At the moment the language support is restricted to English, French and Romanian - but adding new languages is simply a matter of defining a keyword mapping. The project is looking for help creating new mappings.

You can even swap languages in mid program by including a language indicator:

fonction fn()

As well as simply allowing keywords to be translated there is also a facility that allows objects to define alternative names for methods and properties. For example:

// This object has a method with a 
// default name of go() var obj = new Object(); obj.go = function() {...}; // In French, you can use aller()
// to call the go() method obj['fr':'aller'] = 'go';
// In the French language mode,
// aller() will be mapped to // the go() method obj.aller(); // In the French language mode,
// you can also use the default // name go() to call the method // obj.go();

This allows mappings to be created for libraries and APIs that makes them multilingual as well.

Programming languages in an ever growing world cannot hope to simply work in English but little thought has been given to creating multilingual standards for languages. You might well conclude that English is a perfectly good abstract language and quite sufficient.

However consider how you might feel if the next big language was invented in China with no English translation. That is one way for the emerging world to lock us out of their expansion plans.

Perhaps we do need to look at ways of accommodating more than just English within programming languages.

More Information

Find out more about Babylscript and perhaps create a translation mapping for your own language at:



IBM Debater Argues Like A Human - But How?

IBM is the outlier when it comes to AI. Most other companies are taking the neural network path, but IBM is very much into old-fashioned engineering. The new system has neural networks involved, but t [ ... ]

Canada's RAND Immigration Lottery Not Random!

Well of course it isn't, but that doesn't stop people who should no better from stirring up a mock disgust and alarm. Oh dear we programmers are at it again, cutting corners with our job lot of not-qu [ ... ]

More News

Last Updated ( Sunday, 25 December 2011 )

RSS feed of news items only
I Programmer News
Copyright © 2018 All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.