{"id":24620124,"url":"https://github.com/IppClub/YueScript","last_synced_at":"2025-10-06T12:31:07.232Z","repository":{"id":40370668,"uuid":"96284278","full_name":"IppClub/YueScript","owner":"IppClub","description":"A MoonScript dialect compiles to Lua.","archived":false,"fork":false,"pushed_at":"2025-01-22T07:23:49.000Z","size":3212,"stargazers_count":480,"open_issues_count":42,"forks_count":40,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-01-24T14:08:05.380Z","etag":null,"topics":["cpp","lua","moonscript","transpiler","yuescript"],"latest_commit_sha":null,"homepage":"http://yuescript.org","language":"C++","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/IppClub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-05T06:25:42.000Z","updated_at":"2025-01-22T07:23:53.000Z","dependencies_parsed_at":"2024-03-25T01:30:38.336Z","dependency_job_id":"0adfcae8-0e34-4bcb-9efd-838b77d4d5ca","html_url":"https://github.com/IppClub/YueScript","commit_stats":{"total_commits":663,"total_committers":16,"mean_commits":41.4375,"dds":0.03167420814479638,"last_synced_commit":"f38c4f94c9ba0499d923e59483d6381b97cce926"},"previous_names":["ippclub/yuescript"],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IppClub%2FYueScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IppClub%2FYueScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IppClub%2FYueScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IppClub%2FYueScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IppClub","download_url":"https://codeload.github.com/IppClub/YueScript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235524154,"owners_count":19003817,"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":["cpp","lua","moonscript","transpiler","yuescript"],"created_at":"2025-01-25T01:02:51.920Z","updated_at":"2025-10-06T12:31:07.220Z","avatar_url":"https://github.com/IppClub.png","language":"C++","readme":"# YueScript\n\n\u003cimg src=\"doc/docs/.vuepress/public/image/yuescript.png\" width=\"300\" height=\"300\" alt=\"logo\"/\u003e\n\n[![IppClub](https://img.shields.io/badge/IppClub-Certified-11A7E2?logo=data%3Aimage%2Fsvg%2Bxml%3Bcharset%3Dutf-8%3Bbase64%2CPHN2ZyB2aWV3Qm94PSIwIDAgMjg4IDI3NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWw6c3BhY2U9InByZXNlcnZlIiBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjIiPjxwYXRoIGQ9Im0xNDYgMzEgNzIgNTVWMzFoLTcyWiIgc3R5bGU9ImZpbGw6I2Y2YTgwNjtmaWxsLXJ1bGU6bm9uemVybyIvPjxwYXRoIGQ9Im0xNjkgODYtMjMtNTUgNzIgNTVoLTQ5WiIgc3R5bGU9ImZpbGw6I2VmN2EwMDtmaWxsLXJ1bGU6bm9uemVybyIvPjxwYXRoIG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https://github.com/pigpigyyy/Yuescript/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/pigpigyyy/Yuescript/actions/workflows/ubuntu.yml) [![Windows](https://github.com/pigpigyyy/Yuescript/actions/workflows/windows.yml/badge.svg)](https://github.com/pigpigyyy/Yuescript/actions/workflows/windows.yml) [![macOS](https://github.com/pigpigyyy/Yuescript/actions/workflows/macos.yml/badge.svg)](https://github.com/pigpigyyy/Yuescript/actions/workflows/macos.yml) [![Discord Badge](https://img.shields.io/discord/844031511208001577?color=5865F2\u0026label=Discord\u0026logo=discord\u0026logoColor=white\u0026style=flat-square)](https://discord.gg/cRJ2VAm2NV)\n\nYueScript is a MoonScript dialect. It is derived from [MoonScript language](https://github.com/leafo/moonscript) 0.5.0 and continuously adopting new features to be more up to date. \n\nMoonScript is a language that compiles to Lua. Since original MoonScript has been used to write web framework [lapis](https://github.com/leafo/lapis) and run a few business web sites like [itch.io](https://itch.io) and [streak.club](https://streak.club) with some large code bases. The original language is getting too hard to adopt new features for those may break the stablility for existing applications.\n\nSo YueScript is a new code base for pushing the language to go forward and being a playground to try introducing new language syntax or programing paradigms to make MoonScript language more expressive and productive.\n\nYue (月) is the name of moon in Chinese and it's pronounced as [jyɛ].\n\n\n\n## About Dora SSR\n\nYueScript is being developed and maintained alongside the open-source game engine [Dora SSR](https://github.com/ippclub/Dora-SSR). It has been used to create engine tools, game demos and prototypes, validating its capabilities in real-world scenarios while enhancing the Dora SSR development experience.\n\n\n\n## Features\n\n* Based on modified [parserlib](https://github.com/axilmar/parserlib) library from Achilleas Margaritis with some performance enhancement. **lpeg** library is no longer needed.\n* Written in C++17.\n* Support most of the features from MoonScript language. Generate Lua codes in the same way like the original compiler.\n* Reserve line numbers from source file in the compiled Lua codes to help debugging.\n* More features like macro, existential operator, pipe operator, Javascript-like export syntax and etc.\n* See other details in the [changelog](./CHANGELOG.md). Find document [here](http://yuescript.org).\n\n\n\n## Installation \u0026 Usage\n\n* **Lua Module**\n\n\u0026emsp;\u0026emsp;Build `yue.so` file with\n\n```sh\n\u003e make shared LUAI=/usr/local/include/lua LUAL=/usr/local/lib/lua\n```\n\n\u0026emsp;\u0026emsp;Then get the binary file from path `bin/shared/yue.so`.\n\n\u0026emsp;\u0026emsp;Or you can install [luarocks](https://luarocks.org), a package manager for Lua modules. Then install it as a Lua module with\n\n```sh\n\u003e luarocks install yuescript\n```\n\n\u0026emsp;\u0026emsp;Then require the YueScript module in Lua:\n\n```Lua\nrequire(\"yue\")(\"main\") -- require `main.yue`\n\nlocal yue = require(\"yue\")\nlocal codes, err, globals = yue.to_lua([[\nf = -\u003e print \"hello world\"\nf!\n]],{\n  implicit_return_root = true,\n  reserve_line_number = true,\n  lint_global = true\n})\n```\n\n\n\n* **Binary Tool**\n\n\u0026emsp;\u0026emsp;Clone this repo, then build and install executable with:\n```sh\n\u003e make install\n```\n\n\u0026emsp;\u0026emsp;Build YueScript tool without macro feature:\n```sh\n\u003e make install NO_MACRO=true\n```\n\n\u0026emsp;\u0026emsp;Build YueScript tool without built-in Lua binary:\n```sh\n\u003e make install NO_LUA=true\n```\n\n\u0026emsp;\u0026emsp;Use YueScript tool with:\n\n```sh\n\u003e yue -h\nUsage: yue [options|files|directories] ...\n\n   -h       Print this message\n   -e str   Execute a file or raw codes\n   -m       Generate minified codes\n   -r       Rewrite output to match original line numbers\n   -t path  Specify where to place compiled files\n   -o file  Write output to file\n   -s       Use spaces in generated codes instead of tabs\n   -p       Write output to standard out\n   -b       Dump compile time (does not write output)\n   -g       Dump global variables used in NAME LINE COLUMN\n   -l       Write line numbers from source codes\n   -j       Disable implicit return at end of file\n   -c       Reserve comments before statement from source codes\n   -w path  Watch changes and compile every file under directory\n   -v       Print version\n   --       Read from standard in, print to standard out\n            (Must be first and only argument)\n\n   --target=version  Specify the Lua version that codes will be generated to\n                     (version can only be 5.1, 5.2, 5.3 or 5.4)\n   --path=path_str   Append an extra Lua search path string to package.path\n\n   Execute without options to enter REPL, type symbol '$'\n   in a single line to start/stop multi-line mode\n```\n\u0026emsp;\u0026emsp;Use cases:  \n\u0026emsp;\u0026emsp;Recursively compile every YueScript file with extension `.yue` under current path:  `yue .`  \n\u0026emsp;\u0026emsp;Compile and save results to a target path:  `yue -t /target/path/ .`  \n\u0026emsp;\u0026emsp;Compile and reserve debug info:  `yue -l .`  \n\u0026emsp;\u0026emsp;Compile and generate minified codes:  `yue -m .`  \n\u0026emsp;\u0026emsp;Execute raw codes:  `yue -e 'print 123'`  \n\u0026emsp;\u0026emsp;Execute a YueScript file:  `yue -e main.yue`\n\n\n\n## Editor Support\n\n* [Vim](https://github.com/pigpigyyy/YueScript-vim)\n* [ZeroBraneStudio](https://github.com/pkulchenko/ZeroBraneStudio/issues/1134) (Syntax highlighting)\n* [Visual Studio Code](https://github.com/pigpigyyy/yuescript-vscode)\n\n\n\n## License\n\nMIT\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIppClub%2FYueScript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIppClub%2FYueScript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIppClub%2FYueScript/lists"}