激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

服務(wù)器資訊|IT/互聯(lián)網(wǎng)|云計(jì)算|區(qū)塊鏈|軟件資訊|操作系統(tǒng)|手機(jī)數(shù)碼|百科知識|免費(fèi)資源|頭條新聞|

服務(wù)器之家 - 新聞資訊 - IT/互聯(lián)網(wǎng) - 文言文亦能編程,該項(xiàng)目在GitHub摘得5500星

文言文亦能編程,該項(xiàng)目在GitHub摘得5500星

2019-12-18 21:29IT之家騎士 IT/互聯(lián)網(wǎng)

12月18日消息 有中國開發(fā)者上傳的 文言文 編程語言項(xiàng)目已經(jīng)在 GitHub 上摘得了5500星,你可知如何用文言文輸出Hello World?吾有一言。曰「「問天地好在。」」。書之。 據(jù)悉,該文言文 編程 語言來自CMU本科生Huang Lingdong??删幾g成

12月18日消息 有中國開發(fā)者上傳的文言文編程語言項(xiàng)目已經(jīng)在GitHub上摘得了5500星,你可知如何用文言文輸出“Hello World”?吾有一言。曰「「問天地好在?!埂?。書之。

據(jù)悉,該文言文編程語言來自CMU本科生Huang Lingdong??删幾g成Javascript,也可編譯成Python,亦有線上編輯器 (IDE) 可直接運(yùn)行。

GitHub地址:https://github.com/LingDong-/wenyan-lang

文言文亦能編程,該項(xiàng)目在GitHub摘得5500星

夫唐、虞之世,結(jié)繩而足治,屈指而足算。是時豈料百代之後,計(jì)算機(jī)械之巧,精於公輸之木鳶,善於武侯之流馬;程式語言之多,繁若《天官》之星宿,奇勝《山經(jīng)》之走獸。鼠、蟹、鑽、魚,或以速稱。蛇、象、駱、犀,各爭文采。方知鬼之所以夜哭,天之所以雨粟。然以文言編程者 ,似所未有。此誠非文脈之所以傳,文心之所以保。嗟予小子,遂有斯志。然則數(shù)寸之烏絲猶覆於頭,萬卷之素書未破於手;一身長羈于遠(yuǎn)邦,兩耳久曠于雅言。然夫文章者吾之所宿好,程式者偶承時人之謬譽(yù)。故希孟不慚年少,莊生不望無涯。乃作斯言。誠未能嘔瀝長吉之心血,亦庶幾免於義山之流沫。既成之後,復(fù)學(xué)干將鑄劍而自飼,越王嚐糞而當(dāng)先。自謂偶追《十書》之筆意,但恨少八家之淋漓。此子山所謂士衡撫掌而甘心,平子見陋而固宜。然則雖實(shí)覆甕之質(zhì),尚存斧正之望;雖乏呂相之金,易字之渴蓋同。此亦開源之大義,吾輩之所以勉勵也。一笑。

Hello world

Wenyan:

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

Equivalent JavaScript:

 

var n = 3;
for (var i = 0; i < n; i++) {
console.log("問天地好在。");
}

Output:

問天地好在。 
問天地好在。 
問天地好在。

Punctuations and newlines are completely optional (just like they are in Classical Chinese), so the above code is equivalent to:

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

More sophisticated examples, such as the Sieve of Eratosthenes, Quicksort, Mandelbrot set, and Tower of Hanoi, can be found in the ./examples folder.

Features

InstallationThe Compiler

Clone the repo, (OR simply download ./build/wenyan.js and set its executable bit using the terminal command chmod +x wenyan.js). Then run ./build/wenyan.js to compile your wenyan souce code to target language. Calling the compiler without arguments prints the help message, reproduced below:

Usage: wenyan [options] [input files]
Options:
--eval    -<string>  : Give a string instead of a file (default: `')
--exec    -x <boolean> : Execute output (default: `false')
--inspect -i <boolean> : Interactive REPL (default: `false')
--lang    -<string>  : Language: js/py (default: `js')
--log        <string>  : Log file (default: `/dev/null')
--output  -o <string>  : Output file (default: `/dev/stdout')
--roman   -<boolean> : Romanize identifiers (default: `true')

Try building the included examples first, e.g.:

./build/wenyan.js examples/helloworld.wy -o helloworld.js

Building platform-specific binaries

  • Clone the repo

  • npm install

  • npm run make_cmdline

The macOS, Windows and Linux binaries will be in the ./build folder.

文言文亦能編程,該項(xiàng)目在GitHub摘得5500星

Syntax Cheatsheet

A context-free grammar description is under construction. Meanwhile, please check the cheatsheet below, or look into src/parser.js to learn about the syntax. Be sure to check out the examples from the online IDE too!

文言文亦能編程,該項(xiàng)目在GitHub摘得5500星

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 国产精品一区二区羞羞答答 | 一级毛片免费观看在线 | 国产精品性夜天天视频 | 久久久久久高清 | 特级无码毛片免费视频尤物 | 热久久91| 成人免费一区二区三区在线观看 | 国产在线精品一区二区夜色 | 日韩99| 精品国产96亚洲一区二区三区 | 二区国产| 爱逼av | 91精品久久久久久久 | 久久久久久艹 | 在线观看网址av | 午夜激情视频免费 | 国产一区二区三区视频在线观看 | 素人视频免费观看 | 国产xxxxx在线观看 | 亚洲片在线观看 | 国产一区二区视频在线播放 | 亚洲片在线 | 草人人| 精品久久久久久久久久久久久久 | 性高湖久久久久久久久aaaaa | 日韩视| 国产成人精品免费视频大全最热 | 亚洲第一成人在线视频 | 国产精品久久久久免费视频 | 中文字幕在线观看网址 | 在线观看中文字幕av | 911网站大全在线观看 | 国产一区二区二 | 久久av电影院| 污黄视频在线播放 | 黄网站在线免费看 | 黄色大片网站在线观看 | 日本精品一二区 | 日本精品中文字幕 | 久久日韩在线 | 久久天 |