Programming Languages Aren't In English

Some time ago I watched a talk on HYTRADBOI, where I got introduced to yet another programming language that tries to work with different locales (meaning that expressions can be in different languages, not just string values).

This is a line of Hedy code “in French”:

répète 3 fois affiche "Hedy est amusante !"

To make it work is an interesting engineering task of course, I’m not challenging that.

However, I couldn’t help but got triggered by the whole idea of localization of a programming language, which kinda implies that there is some language to translate.

There is none. Programming languages have almost nothing to do with English.

This is Python:

for name in ["Bob", "Alice", "Peter"]:
    print(name)

Yes, you kinda can read it like it’s English:

for (each) name in (the list) ["Bob", "Alice", "Peter"]:
	print (that) name

But this is just a coincidence. OK, people actually tried hard to make it look more like English, intentionally, so it’s not a pure coincidence. But it still could be anything else.

Here is a somewhat equivalent Zig code:

for (names) |name| {
  std.debug.print("{s}\n", .{name});
}

Apart from naming of variables / packages / functions, the language syntax is just for (..) |..| {..}. Not many signs of a natural language left, but it barely changes anything, not only for experienced programmers, but for anybody who were capable of reading the Zig tutorial.

Now make it i_ (..) |..| {..} where i_ would stand for ‘iterate’, and an unprepared reader would be completely lost, yet for a programmer there is literally no difference.

Yes, I still used English to name a command. To make my point, I can say that z_ would work just as well. It’s just slightly better when we use mnemonics, like with any naming.

Programming languages provide instructions and allow us to make expressions. Some of those instructions are keywords, others may be purely symbolic. But for me as a person who doesn’t at all speak Japanese the only bummer about using みせる instead of print is that it’s a very unusual locale (for me) and my keyboard is not well suited for it (neither is my brain, but surely I can memorize 20 random keywords no problem). This is not true for English, which is on (almost?) every keyboard in the world, and every computer user types in English from time to time.

Language is not just words, and 99.9% of what language is has nothing to do with programming.

This is Go with non-ASCII variables:

package main

import "fmt"

var написать = fmt.Println

func main() {
	привет := "привет"
	написать(привет)
}

It compiles, and it runs. There is nothing more to localize. Please don’t do this though, or you will piss off your coworkers.