Programming In Chinese Language! Really!!

chinese programming language
A rendering of the divination.wy program written in wenyan-lang by Lingdong Huang

There are thousands of programming languages, with different methodologies, but the one thing common to all these languages is that they are in English-like language, use English alphabets, English numerals, and punctuation symbols like !, ; =, !=, etc, all from the English language. English has a monopoly over programming. But that was until now.

Now, the world’s first programming language based on classical Chinese has been developed and dozens of programs have been written in it. One of the famous programs is the one based on an ancient Chinese fortune-telling algorithm, described in the I-Ching, the oldest of the Chinese classics.

The language has been developed by Lingdong Huang, a graduate in computer science and art from the Carnegie Mellon University. Huang is also famous for having created the infinite computer-generated Chinese landscape painting. He also created the first and so far only AI-generated Chinese opera. This Chinese Kunqu Opera performance, with its script, music and visuals was entirely generated using machine learning techniques such as RNN, pix2pixHD, etc.

This new programming language is called wenyan-lang. This language closely follows the grammar and tone of classical Chinese literature. The alphabet of wenyan contains only traditional Chinese characters and 「」 quotes, so it is guaranteed to be readable by ancient Chinese people. You too can try it out on the online editor. By the way, once you are in this site, you will see a code in Chinese. Google Chrome will give you an option to translate this to English. Try that and see the fun! wenyan currently compiles to JavaScript, Python, or Ruby, and will support more languages (e.g. C) in the future.

So what does Wenyan-lang consist of? This language uses both traditional Chinese characters and classical Chinese grammar. Classical Chinese does not use spaces to divide sentences into words, and this was a challenging task in the design of Wenyan-lang. A programming language must take care of the syntax and semantics and doing both these, developing compilers, libraries for Chinese language is a challenging task in itself. This programming language only possess a set amount of keywords.

Contributors on wenyan-lang are working on transpilers for Python, Ruby, JavaScript, C++, and Java, libraries for GUI, and graphics. A snippet site is also in the works where contributors can share bits of code. Once in this site, you will see the option to run many programs, e.g. the one on Madelbrot pattern as shown below. To run the program, click the little triangle.

Code in Wenyan-lang to generate Mandelbrot Pattern

Huang is working on an introductory guide to programming in wenyan-lang. This guide is itself written in classical Chinese. So who is this computer programming language targeted at? The target audience of the book can be someone with no prior experience with programming at all.

So is this the next big thing after Python? Wait and watch. And learn Chinese! Or plan to research on creating a programming language in Hindi.

Categories: Blog, Computer Science, Programming

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: