Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

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

Javascript runs on nearly any platform. Most languages can compile to Javascript. It’s well-positioned to become the lingua franca of programmers, with one problem: Like most programming languages, Javascript is based on English. 89% of the world’s population doesn’t speak any English. Many of those people can’t even read the Latin script. If we want Javascript to be a lingua franca, we need to ensure it is accessible to all people, regardless of their native language.

Let’s look at the barriers that non-native speakers face when contributing to OSS Javascript projects and what it would take to remove them entirely, so that two developers could collaborate without speaking the same language. We will see what techniques Javascript can borrow from other languages by taking a look at করো (koro), a project which adds Bengali support to the Go compiler. And, we will learn enough about compilers and character encoding to answer the eternal question: “Could we do this in Javascript?”

Aditya Mukerjee

June 01, 2019

More Decks by Aditya Mukerjee

Other Decks in Technology


  1. : Translating Code to Other (Human) Languages and Back Again

    @chimeracoder Aditya Mukerjee Systems Engineer, Stripe
  2. 95% of the world doesn’t speak English as their first

    language 89% of the world doesn't speak English at all @chimeracoder
  3. “I would have thought it would be useful to NATO,

    because they had the common verbs for the things they were going to do. And the nouns, they’d just have to have a dictionary for things they were referring to for inventory control…. They’d have common nouns throughout NATO, and they could make a dictionary of common verbs and translate the program. You could write one in English and you could translate it and it could go to [the other language]. No problem, you’d have communication. It would be a limited vocabulary.” - Grace Hopper @chimeracoder
  4. package main import "fmt" func main() { if true {

    fmt.Printf(“hello, world!\n") } } @chimeracoder
  5. Character encoding Go: • Source code is required by the

    language spec to be UTF-8 • Strings (and byte arrays) are internally treated as UTF-8 JavaScript: • Source code can have any encoding supported by the interpreter • JavaScript: Strings are internally treated as... uhhh… wait… …what?
  6. @chimeracoder Cannot cast parameter type from type “System.String” to argument

    type “System.String” Uncaught SyntaxError: Unexpected token ILLEGAL
  7. The only thing worse than a cryptic error message is

    a cryptic error message in a foreign language that you can’t understand @chimeracoder
  8. 95% of the world doesn’t speak English as their first

    language 89% of the world doesn't speak English at all @chimeracoder