{"id":13442033,"url":"https://github.com/wenyan-lang/wenyan","last_synced_at":"2025-05-13T16:10:33.631Z","repository":{"id":37622993,"uuid":"226726247","full_name":"wenyan-lang/wenyan","owner":"wenyan-lang","description":"文言文編程語言 A programming language for the ancient Chinese.","archived":false,"fork":false,"pushed_at":"2023-10-20T13:39:33.000Z","size":47391,"stargazers_count":19961,"open_issues_count":208,"forks_count":1094,"subscribers_count":246,"default_branch":"master","last_synced_at":"2025-05-08T20:40:06.826Z","etag":null,"topics":["classical-chinese","esoteric-language","programming-language","wenyan-lang"],"latest_commit_sha":null,"homepage":"https://wy-lang.org/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wenyan-lang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-08T20:21:32.000Z","updated_at":"2025-05-08T14:58:42.000Z","dependencies_parsed_at":"2023-12-15T10:47:56.569Z","dependency_job_id":"cd38835e-40b7-44fa-8ade-8a4a7a7231f2","html_url":"https://github.com/wenyan-lang/wenyan","commit_stats":{"total_commits":709,"total_committers":65,"mean_commits":"10.907692307692308","dds":0.6502115655853314,"last_synced_commit":"97f0a4b8c5a815467c5c2cac08215d722efde208"},"previous_names":["lingdong-/wenyan-lang"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenyan-lang%2Fwenyan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenyan-lang%2Fwenyan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenyan-lang%2Fwenyan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenyan-lang%2Fwenyan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wenyan-lang","download_url":"https://codeload.github.com/wenyan-lang/wenyan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253349761,"owners_count":21894780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classical-chinese","esoteric-language","programming-language","wenyan-lang"],"created_at":"2024-07-31T03:01:40.928Z","updated_at":"2025-05-13T16:10:33.581Z","avatar_url":"https://github.com/wenyan-lang.png","language":"TypeScript","funding_links":["https://opencollective.com/wenyan-lang/contribute","https://opencollective.com/wenyan-lang","https://opencollective.com/wenyan-lang/organization/0/website","https://opencollective.com/wenyan-lang/organization/1/website","https://opencollective.com/wenyan-lang/organization/2/website","https://opencollective.com/wenyan-lang/organization/3/website","https://opencollective.com/wenyan-lang/organization/4/website","https://opencollective.com/wenyan-lang/organization/5/website","https://opencollective.com/wenyan-lang/organization/6/website","https://opencollective.com/wenyan-lang/organization/7/website","https://opencollective.com/wenyan-lang/organization/8/website","https://opencollective.com/wenyan-lang/organization/9/website"],"categories":["HarmonyOS","TypeScript","Miscellaneous","其他","Uncategorized"],"sub_categories":["Windows Manager","Other Datasets","网络服务_其他","Uncategorized"],"readme":"\u003cimg src=\"screenshots/logo.png\" align=\"right\" width=\"128\" height=\"128\"/\u003e\n\n# 文言 wenyan-lang\n\n[![npm](https://img.shields.io/npm/v/@wenyan/core)](https://www.npmjs.com/package/@wenyan/core)\n[![build](https://img.shields.io/github/workflow/status/wenyan-lang/wenyan/Build%20%26%20Test)](https://github.com/wenyan-lang/wenyan/actions)\n[![Netlify Status](https://api.netlify.com/api/v1/badges/c36d4838-1c8f-4cfe-986e-43e0de6f71a3/deploy-status)](https://app.netlify.com/sites/wenyan-lang/deploys)\n\n### [wy-lang.org](https://wy-lang.org) | [Wiki](https://github.com/wenyan-lang/wenyan/wiki) | [The Book](https://github.com/wenyan-lang/book)\n\nEnglish | [简体中文](./README.zh-Hans.md) | [繁體中文](./README.zh-Hant.md)\n\n文言文編程語言。A programming language for the ancient Chinese. [Try it online.](https://ide.wy-lang.org/)\n\n![](screenshots/screenshot01.png)\n\n[**CHANGELOG**](./CHANGELOG.md)\n\n## 序\n\n\u003e 夫[唐](https://en.wikipedia.org/wiki/Emperor_Yao)、[虞](https://en.wikipedia.org/wiki/Emperor_Shun)之世，[結繩而足治](https://ctext.org/book-of-changes/xi-ci-xia/zh)，屈指而足算。是時豈料百代之後，計算機械之巧，精於[公輸](https://en.wikipedia.org/wiki/Lu_Ban)之[木鳶](https://en.wikipedia.org/wiki/Lu_Ban#Inventions)，善於[武侯](https://en.wikipedia.org/wiki/Zhuge_Liang)之[流馬](https://en.wikipedia.org/wiki/Wooden_ox)；程式語言之多，繁若[《天官》](https://ctext.org/shiji/tian-guan-shu/zh)之星宿，奇勝[《山經》](https://en.wikipedia.org/wiki/Classic_of_Mountains_and_Seas)之走獸。[鼠](https://golang.org/)、[蟹](https://www.rust-lang.org/)、[鑽](https://www.ruby-lang.org/en/)、[魚](https://fishshell.com/)，或以速稱。[蛇](https://www.python.org/)、[象](https://www.php.net/)、[駱](https://www.perl.org/)、[犀](http://shop.oreilly.com/product/9780596805531.do)，各爭文采。方知[鬼之所以夜哭，天之所以雨粟](https://ctext.org/huainanzi/ben-jing-xun/zh)。然以文言編程者 ，似所未有。此誠非文脈之所以傳，文心之所以保。[嗟予小子](https://zh.wikisource.org/zh-hant/%E6%A6%AE%E6%9C%A8_(%E9%99%B6%E6%B7%B5%E6%98%8E))，遂有斯志。然則數寸之烏絲猶覆於頭，[萬卷之素書未破於手](https://zh.wikisource.org/zh-hant/%E5%A5%89%E8%B4%88%E9%9F%8B%E5%B7%A6%E4%B8%9E%E4%B8%88%E4%BA%8C%E5%8D%81%E4%BA%8C%E9%9F%BB)；一身長羈於遠邦，兩耳久曠于[雅言](https://zh.wikipedia.org/wiki/%E9%9B%85%E9%9F%B3)。然夫文章者吾之所宿好，程式者偶承時人之謬譽。故[希孟](https://en.wikipedia.org/wiki/Wang_Ximeng)不慚年少，[莊生](https://en.wikipedia.org/wiki/Zhuang_Zhou)不望[無涯](https://ctext.org/zhuangzi/nourishing-the-lord-of-life/zh)。乃作斯言。誠未能嘔瀝[長吉](https://en.wikipedia.org/wiki/Li_He)之[心血](https://zh.wikisource.org/zh-hant/%E6%9D%8E%E8%B3%80%E5%B0%8F%E5%82%B3)，亦庶幾免於[義山](https://en.wikipedia.org/wiki/Li_Shangyin)之[流沫](https://zh.wikisource.org/zh-hant/%E9%9F%93%E7%A2%91)。既成之後，復學[干將鑄劍](https://zh.wikisource.org/wiki/%E9%91%84%E5%8A%8D)而自飼，[越王嚐糞](https://ctext.org/wu-yue-chun-qiu/yue-wang-gou-jian-wu-nian/zh)而當先。自謂偶追[《十書》](https://en.wikipedia.org/wiki/Ten_Computational_Canons)之筆意，但恨少[八家](https://en.wikipedia.org/wiki/Eight_Masters_of_the_Tang_and_Song)之淋漓。此[子山](https://en.wikipedia.org/wiki/Yu_Xin)所謂[士衡撫掌而甘心，平子見陋而固宜](https://zh.wikisource.org/zh-hant/%E5%93%80%E6%B1%9F%E5%8D%97%E8%B3%A6)。然則雖實[覆甕](https://zh.wikisource.org/zh-hant/%E6%99%89%E6%9B%B8/%E5%8D%B7092#%E5%B7%A6%E6%80%9D)之質，尚存斧正之望；雖乏[呂相](https://en.wikipedia.org/wiki/L%C3%BC_Buwei)之金，[易字](https://zh.wikisource.org/zh/%E5%8F%B2%E8%A8%98/%E5%8D%B7085)之渴蓋同。此亦開源之大義，吾輩之所以勉勵也。一笑。\n\n## Helloworld\n\nWenyan:\n\n```\n吾有一數。曰三。名之曰「甲」。\n為是「甲」遍。\n\t吾有一言。曰「「問天地好在。」」。書之。\n云云。\n```\nEquivalent JavaScript:\n\n```JavaScript\nvar n = 3;\nfor (var i = 0; i \u003c n; i++) {\n\tconsole.log(\"問天地好在。\");\n}\n```\n\nOutput:\n\n```\n問天地好在。\n問天地好在。\n問天地好在。\n```\n\nPunctuations and newlines are completely optional (just like they are in Classical Chinese), so the above code is equivalent to:\n\n```\n吾有一數曰三名之曰「甲」為是「甲」遍吾有一言曰「「問天地好在」」書之云云\n```\n\nMore sophisticated examples, such as the Sieve of Eratosthenes, Quicksort, Mandelbrot set, and Tower of Hanoi, can be found in the `./examples` folder.\n\n## Features\n- [Natural Language Programming](https://en.wikipedia.org/wiki/Natural-language_programming) sharing the grammar of [Classical Chinese](https://en.wikipedia.org/wiki/Classical_Chinese)\n- Compiles to [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript), [Python](https://python.org), or [Ruby](http://ruby-lang.org)\n- [Turing complete](https://github.com/wenyan-lang/wenyan/blob/master/examples/turing.wy)\n- An [Online IDE](https://ide.wy-lang.org/)\n- [Examples](https://github.com/wenyan-lang/wenyan/tree/master/examples) to get started\n- A packages manager [wyg(文淵閣)](https://github.com/wenyan-lang/wyg) and [awesome packages](http://wyg.wy-lang.org/) from the community.\n\n\n## Try it out\n\n### [The Online IDE](https://ide.wy-lang.org/)\n\n![](screenshots/screenshot02.png)\n\n### Text Editor Plugins\n\n- [Plugin for VSCode](https://github.com/antfu/wenyan-lang-vscode) by [antfu](https://github.com/antfu)\n- [Plugin for Vim](https://github.com/voldikss/vim-wenyan) by [voldikss](https://github.com/voldikss)\n- [Plugin for Sublime Text](https://github.com/absop/SublimeWenyan) by [absop](https://github.com/absop)\n\n### Command Line Compiler\n\nInstall the compiler by\n\n```bash\nnpm install -g @wenyan/cli\n```\n\nTry run the included examples, e.g.:\n\n```bash\nwenyan examples/helloworld.wy\n# will output: 問天地好在。\n```\n\n### [The Decompiler](https://zxch3n.github.io/wenyanizer/)\n\nYou can now translate JavaScript to wenyan-lang using the [wenyanizer](https://github.com/zxch3n/wenyanizer) by [zxch3n](https://github.com/zxch3n).\n\n### 3rd Party Compilers\n\n- [JVM compiler](https://github.com/MagicLu550/wenyan-lang_jvm) by [MagicLu550](https://github.com/MagicLu550)\n\n\n## Documentation\n\nCheck out our [Wiki pages](https://github.com/wenyan-lang/wenyan/wiki)\n\n- [Syntax Cheatsheet](https://github.com/wenyan-lang/wenyan/wiki/Syntax-Cheatsheet)\n- [Standard Library Cheatsheet](https://github.com/wenyan-lang/wenyan/wiki/Standard-Library-Cheatsheet)\n- [Library Packages](https://github.com/wenyan-lang/wenyan/wiki/Available-Packages)\n- [Contributing](https://github.com/wenyan-lang/wenyan/wiki/Contributing)\n- [API Specifications](https://github.com/wenyan-lang/wenyan/wiki/Compiler-API)\n- [Browser Runtime](https://github.com/wenyan-lang/wenyan/wiki/Browser-Runtime)\n- [Feature Requests](https://github.com/wenyan-lang/wenyan/wiki/Feature-Requests)\n- [Known Issues](https://github.com/wenyan-lang/wenyan/wiki/Known-Issues)\n\n## Contributors\n\n### Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/wenyan-lang/wenyan/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/wenyan-lang/contribute)]\n\n#### Individuals\n\n\u003ca href=\"https://opencollective.com/wenyan-lang\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/individuals.svg?width=890\"\u003e\u003c/a\u003e\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/wenyan-lang/contribute)]\n\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/0/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/1/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/2/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/3/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/4/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/5/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/6/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/7/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/8/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/wenyan-lang/organization/9/website\"\u003e\u003cimg src=\"https://opencollective.com/wenyan-lang/organization/9/avatar.svg\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenyan-lang%2Fwenyan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwenyan-lang%2Fwenyan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenyan-lang%2Fwenyan/lists"}