The best programming language of the year is here! Seniors invented classical Chinese programming language

2019/12/2121:05:10 technology 2213

The front line of open source (ID: OpenSourceTop) Apemei comprehensive compilation


Apemei has used Weibo, Moments of Friends, and public accounts in the past two days, and found that everyone is all Was a fan of a classical Chinese programming project.


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


Even teacher Liu Qun, a researcher at the Institute of Computing Technology of the Chinese Academy of Sciences and a well-known expert in the field of machine translation, praised: Housheng Kewei#04a7a0


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


What kind of fairy project is it that has received such a high evaluation? It turns out that this is a classical Chinese-based programming language developed by a senior at Carnegie Mellon University (CMU).


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


This project is called Lingdong, it can be compiled into Javascript, it can also be compiled into Python, and there is an online editor for direct run. Now it has been marked with stars 7K, 324 Fork on Github (Github address: https://github.com/LingDong-/)


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


And before posting, Lingdong duly dominated the GitHub Trending daily list and won 4000+ Stars in a single day! Let's take a look at how Lingdong works.


If you want to know how to output "Hello World" in classical Chinese? , You will find it is like this:


 I have a number. Said three. The name is called "A". It is "A" times. I have a word. Said ""Ask the world for good."". Of the book. So much. 


is compiled into JavaScript like this:


varn=3;for(vari=0;i


The output is like this


Wen the world is good. Ask the world for good. Ask the world for good. 


Another example, when we were programming in college, there would always be a practice question to find prime numbers within 100. What would it look like in classical Chinese? At this time, you have to use an algorithm called "Essier Sieve", the full text is as follows:


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


Compile The JavaScript is as follows:


var Aisisi=()=>0; Aisisi=function(甲){varmask=[];for(var_rand1=0; _rand1<甲;_rand1++){mask.push(true);};var_ans1=甲/2;var>


Finally, let’s take a look at the running results:


2,3,5 ,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97


Yuanmei can’t find classical Chinese to praise it, so she can only say one word: cow! ! !


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


In addition, the author also provides an online IDE, you might as well try it now, address: http:/ /wenyan-lang.lingdong.works/ide.html


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


Do you think this is enough? Of course not, the author also made a demo of the Turing machine:


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


Related syntax table 0d5a1a#04a7c#4da#

Below, we are taking a look at the relevant grammar table, for example how he defines a variable:


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


How are some other operations defined? As follows:


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


and basic mathematical operations:


11a7d#

11a7d#


Finally there is a function definition:


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


4 see here only I can sigh that I am uneducated, and I didn't use my brain to code.


Installation and use


Having said so much, how to install and use it? You just need to clone this project, (or directly downloadLoad ./build/wenyan.js and give it execution permission, enter chmod +x wenyan.js) in the terminal. Then execute ./build/wenyan.js to compile the source code into the target language. If you execute this command without any parameters, the following help information is output.


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews

Then you can try to compile a few simple examples:


./build/wenyan. jsexamples/helloworld.wy-ohelloworld.js


If you are just an early adopter, you can experience it through the IDE address in front.


About the author


The author is a senior at Carnegie Mellon University who will obtain computer science in 2020 Degree. Although I haven't graduated yet, I have already had multiple internship experiences. It also has its own personal project website.


The best programming language of the year is here! Seniors invented classical Chinese programming language - DayDayNews


Through his Github homepage, you can also find many interesting projects, such as Chinese landscape paintings that can be generated infinitely with programs , Age2death (the vibrato is very hot watching you grow old), edges2calligraphy (turn your graffiti into Chinese calligraphy) metric poetry editing program, hermits, etc. From these projects, it can be seen that this is an impact on Chinese culture Very interested little brother.


Finally, attach his homepage address: https://lingdong.works/


technology Category Latest News