করো: Translating Go to Other (Human) Languages, and Back Again

করো: Translating Go to Other (Human) Languages, and Back Again

In The Hitchhikers’s Guide to the Galaxy, the Babel Fish is a universal translator. By allowing all beings to communicate regardless of language, it ‘neatly crosses the language divide between any species’.

While Go uses English keywords, because of the way Go’s lexer and parser are designed, we can easily port Go to other languages and still maintain interoperability between different dialects of Go. gofmt already bridges the divide between two seemingly-incompatible groups of developers — those who prefer tabs and those who prefer spaces — and allows them to collaborate seamlessly, with no extra effort for either group. We can extend this approach further, and allow developers who only speak English to collaborate seamlessly with developers who don’t speak English at all.

In this talk, we will look at koro, which adds Bengali support for the Go toolchain. The koro extension lets native Bengali speakers program in the language most familiar to them, but provides bidirectional translation layers so that all Go programmers only ever see code written in their native language.

This same technique can be used to add support in the Go toolchain for Korean, Russian, Tagalog, or any other natural language that Go programmers want to use when programming, making Go the ultimate Babel Fish for programmers everywhere

94dcff33cbdf74b5d785369ac54bc1a8?s=128

Aditya Mukerjee

April 25, 2017
Tweet