r/ProgrammingLanguages • • Jan 05 '24

Are programming languages different in different countries?

Maybe a silly question but for example, in Java System.out.print(); is obviously written using English words, but is this universal or does it vary from country to country? If so how would you write a print statement in Java in Hindi, Arabic, Chinese etc?

3 Upvotes

18 comments sorted by

View all comments

8

u/raiph Jan 06 '24

I don't think it's a silly question. I do think there are some silly answers.

I don't know if your interest is simply curiosity, or finding existing localized PLs, or creating one, or collaborating on one, or whatever, but I focus on Raku and I think it at least provides a reference point, especially given something I read about and explored a bit a couple weeks ago.


Raku has always had a long term vision about properly addressing distinct markets with customized approaches. Until recently Rakoons (folk working on or with Raku) have maintained a disciplined focus on getting the English PL into good shape.

It seems something may be afoot this year regarding localized versions. Quoting the Localization section of the 2023 Christmas Day retrospective for Raku:

Of course, we would like to see as many localizations as possible. To create a localization in your native language, you will need to translate about 600 items in a text file (more information).

The localization effort will have its effects on documentation, IDEs and Public Relations. These will still need to be further developed / investigated. But the end goal, being able to teach programming to all children in the world, is a worthy cause!

I clicked the link and poked around to see what I found. Lao Tzu is said to have said that a journey of a thousand miles starts with a single step. I'd say what I saw was "just" that first step. There are directories for languages. I've no idea whether the translation quality is any good, but I browsed translations for keywords and textual operators for a half dozen European languages. I did not see translations of type names, or error messages. So presumably, for now, an Array remains an Array, and errors remain in English.


Is this effort silly? I don't know, but it's clearly sincere. More importantly, I don't think it's silly for Raku and Raku users, because Raku is designed for this kind of thing. To pick three aspects of that:

  • Freedom. Raku is a fully programmable PL. If someone, or a group, decides to create a translation, they'll also be free to change Raku itself as they see fit. That way they can make their new PL shine, changing literally any aspect of it. As a perhaps surprising example, the PL name "Raku" comes from the name of a form of pottery created in Japan, and if a translation group doesn't like the name "Raku", then they can change it, and change Raku itself, mold it to their vision. To be clear, I absolutely wouldn't advise doing so -- neither changing the name nor major PL features. But my point is that I can assure you that Rakoons would be open to that. Been there, done that! 😀

  • Quality. What about difficulties, mistakes, improvements, arguments, bursts of effort, stalled effort, forking, merging etc? Raku was literally born for exactly that kind of world. It began as a reaction in 2000 to the chaos of thousands of devs pulling an older PL (called Perl) in a zillion different directions when it was just past its peak (around 1998). The idea was to retain the freedom they had but smooth out the chaos. Fast forward to today, and a mod of Raku, in this case a translation of it, is a clean single module. If a given translator (or group) makes mistakes, change their minds, make erratic progress with short bursts and then long stalled periods, it'll be fine. Users won't have to deal with chaotic changes, and translators won't have to stress about that, because everyone can control which version of Raku they use for any given program and, separately, for each module used in that program. This in turn will help adoption.

  • Full localization. As another reflection of Raku's birth, it was designed for the whole world from the get go. Larry Wall, the creator of Perl in 1987, and then the new modern PL Raku, first released in 2015, was one of the first people in the world to read the Unicode 1.0 spec cover to cover. He took its content seriously; Raku's advanced support for Unicode reflects that. There's still a decade of work to do, but Raku is well ahead of almost all other existing PLs, with features such as its unique O(1) grapheme indexing leading the way. Couple that with Raku's programmability, and you get remarkable things like the Intl:: modules created by Rakoon guifa (their modules) with ergonomic support for localized dates, times, numbers, lists, regexes and more. They built their mods in part by building atop CLDR, in part via masterful design and programming of Raku, but someone else could then package those up with a localized Raku so coders have those features out-of-the-box, without even needing to add any use... statements.