文言文编程语言

avatar
(Edited)


Wylang 是个用文言文的编程语言。 是一名叫 Huang Lingdong,CMU计算机专业大四学生的杰作。
Wylang 代码基本上可以compile 成 javascript,python 和ruby 。

网址
https://wy-lang.org/

一个基本的 "Hello World" 的代码如下

    吾有一數。曰三。名之曰「甲」。
    為是「甲」遍。
        吾有一言。曰「「問天地好在。」」。書之。
    云云。

斐波那契 Fibonacci:

    吾有一術。名之曰「斐波那契」。欲行是術。必先得一數。曰「甲」。乃行是術曰。
        若「甲」等於零者乃得零也
        若「甲」等於一者乃得一也
        減「甲」以一。減「甲」以二。名之曰「乙」。曰「丙」。
        施「斐波那契」於「乙」。名之曰「丁」。
        施「斐波那契」於「丙」。名之曰「戊」。
        加「丁」以「戊」。名之曰「己」。
        乃得「己」。
    是謂「斐波那契」之術也。
    施「斐波那契」於十二。書之。

階乘 Factorial

吾有一術。名之曰「階乘」。欲行是術。必先得一數。曰「甲」。乃行是術曰。
    若「甲」等於一者。
        乃得「甲」。
    若非。
        減「甲」以一。名之曰「乙」。
        施「階乘」於「乙」。名之曰「丙」。
        乘「丙」以「甲」。名之曰「丁」。
        乃得「丁」
    也。
是謂「階乘」之術也。

施「階乘」於五。書之。

还有很多例子
https://wy-lang.org/ide.html
https://github.com/wenyan-lang/wenyan/tree/master/examples

IEEE 也有cover 相关报导。
https://spectrum.ieee.org/tech-talk/computing/software/classical-chinese?fbclid=IwAR0xJypSdpdrzC1WB4BgQBEZFvH0a6TVU-kcgMpJ9g8oKNA3Mq1Vfo0nxvM



0
0
0.000
1 comments
avatar

Congratulations @tensaix2j! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You distributed more than 17000 upvotes. Your next target is to reach 18000 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Valentine's day challenge - Give a badge to your beloved!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
0
0
0.000