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.

 

babylscript

 

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:

---fr---
fonction fn()
{
   alerter(«bonjour!»);
}

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';
---fr---
// 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:

http://www.babylscript.com

 

Banner


Edera Releases Open Source Container Benchmark And Scanner
07/11/2024

Edera has released Am I Isolated, an open source container security benchmark that probes users runtime environments and tests for container isolation.



OpenAI Releases Swarm
25/10/2024

OpenAI has released an experimental educational framework for exploring ergonomic, lightweight multi-agent orchestration. Swarm is managed by the OpenAI Solution team, but is not intended to be used i [ ... ]


More News

Last Updated ( Sunday, 25 December 2011 )