Purposeful Programming Languages: Non-English Syntaxes
Tags: webdev, programming, opensource, discuss
Published: 2023-04-13 14:58:50

As a native English speaker I am very privileged to be able to jump into almost any programming language and have some basic understanding of the "human-readable" parts. There are a some exceptions in languages like Web Assembly where the constructions and operations can become quite esoteric and verbose where even a native English speaker might have no idea what they imply. With that being said, these ideas present the question of: how do non-native English speakers learn to code?

> All modern programming tools are based on the ASCII character set, which encodes Latin Characters and was originally based on the English Language. As a result, programming has become tied to a single written culture. It carries with it a cultural bias that favors those who grew up reading and writing in that culture.
[source](https://nas.sr/%D9%82%D9%84%D8%A8/)

Well, the first obvious answer is: they learn English as they learn the new programming language. In many parts of the world students train intensely to learn English throughout their grade-schools. Kudos to all of the international students who work hard and navigate this obstacle on top of the others they may face (us Americans are a pretty privileged lot when it comes to things like this...). 

Despite languages like _Python_ (syntax English, created in Holland), _Ruby_ (syntax English, created in Japan) and _Ruby on Rails_ (syntax English, created in Denmark) that were created in countries where English is _not_ the dominant language, the developers still elected to use English as their base syntax. As many of you are aware, English is the _de facto lingua franca_ of the world (actually makes me feel embarrassed at my own privilege once again...). With this in mind, programmers figured that due in part to the international level of digital era it would be best practice to use such a language as their model. As you could imagine, it would be quite difficult to debug your code base if your repository has chunks of it in different languages, potentially that you can't read or pronounce. 

_**BUT**_,
This still disadvantages people who do not speak English or are learning it as a second language. Because of this, there have been a variety of tools to help with this and I will demonstrate a few of them in the following:

![Citrine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xikk6oeoickajt41rn99.png)

## [Citrine](https://citrine-lang.org/)
In an attempt to "democratize software" a flexible, general purpose, scripting language was created. A team of three developers (de Mooji from Holland, Jilani from India, and Litwinow from Russia) released their free and [open source](https://github.com/gabordemooij/citrine) language [Citrine](https://citrine-lang.org/).

![russian](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2l9e89joy2okbg2wf6jf.png)

![romanian](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s33mnbpewjahstwglla3.png)

![english](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ajm0sxdovm6fsfi2civ.png)

According to their website: "Citrine can be used as a stand-alone programming language, an embedded scripting language, DSL or as a transpiler". It seems to have similarities to JavaScript for prototypal inheritance and object orientation. They also claim to be like BASIC and LISP as well. But, coolest of all is Citrine's automatic translation, allowing any member of your team to write in their native language: [docs](https://citrine-lang.org/docs/en/27c4553ad78ede1de736f6aa4b3bbf6e0dd05c24.html?v2023)

This approach seemed to be the most-encompassing but there are also other languages I have found that provide non-English syntax. Some of them are:

## [Qalb](https://nas.sr/%D9%82%D9%84%D8%A8/)
Qalb is the Arabic word for heart and is also the only Arabic programming language: [nas.sr/قلب/](https://nas.sr/%D9%82%D9%84%D8%A8/) Created by developer Ramsey Nasser with the intention of creating an art-forward, functional language: 

> “Arabic people have a very intense relationship to text, and a lot of the culture is predicated on language itself. So I wanted to bring as much of the Arab tradition of calligraphy into the computer science tradition of text and source code.”

[Interview with Nasser](https://www.arabamerica.com/qalb-the-only-arabic-programming-language/)

Qalb is an attempt at making computer programming more approachable in the Arab world. Nasser hopes that Qalb's popularity will spread within the academic scope and make it one step easier for native Arabic speakers to see if they like writing code as well as to hold onto their culture as they enter the professional space.

Qalb is said to have similarities to LISP, C++ and JavaScript. As you can see from the banner image above and below, the code _really_ looks beautiful.

![qalb](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ft5ybhiane3vi24y0jni.png)

## [Wenyan-lang](https://wy-lang.org/): 文言
Another case for non-English programming languages is: [wenyan-lang](https://spectrum.ieee.org/classical-chinese): "an esoteric programming language that closely follows the grammar and tone of classical Chinese literature." After reading into its creator, Lingdong Huang, I would say this language appeals to the opposite approach of what I have mentioned above. That being, a syntax that is less familiar to all, even to contemporary Chinese/Mandarin speakers, in an effort to celebrate the history and artistry of a traditional form instead. In a way, using an esoteric language achieves a similar effect, that is; the crossover of ancient Chinese speakers and software engineers is _so_ small that it evens the playing field much to the same effect as using a syntax that everyone knows. No one knowing a language is the logical inverse of everyone knowing one. 

Wenyan-lang is a difficult language to make comparisons to because traditional Chinese does not use spaces to divide sentences into words. Therefore, "how to split a sentence is the task of the reader... not the writer." This resulted in Huang making the wenyan-lang interpreter go from the longest keywords to the shortest keywords to determine what the programmer wants, "and it works", as he claimed in this [interview](https://spectrum.ieee.org/classical-chinese). 
Here is a link to its online IDE: [wenyan-lang](https://ide.wy-lang.org/)

![chineseHW](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j5bl3iiykkrdpju10vps.png)
Above is an example of using `.wy` to write "Hello World" and below is how it currently compiles to JavaScript, Python or Ruby.

![chineseCOM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vd4uy06qjbhrbmzatxbf.png)

Furthermore, an example of the programming window using the Sieve of Eratosthenese in the language's traditional Chinese Characters and classical Chinese grammar. The language's developer Huang is fascinated by the algorithms of ancient Chinese math and philosophy books and wanted to create a language that maintained the affects of those works. 

![chineseSE](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkjr45zouchiqc66mzpj.png)

The world of non-English software development is expanding and it is a profound and democratic evolution. If you are interested in more, please follow the links I have provided in the Works Cited section to contribute, learn and share. 

## Works Cited

**Citrine**
[language](https://citrine-lang.org/)
[contributions](https://github.com/gabordemooij/citrine)

**Qalb**
[language](https://nas.sr/%D9%82%D9%84%D8%A8/)
[interview](https://www.arabamerica.com/qalb-the-only-arabic-programming-language/)

**Wenyan-lang**
[language](https://wy-lang.org/)
[interview](https://spectrum.ieee.org/classical-chinese)