开源软件名称(OpenSource Name):pigpigyyy/Yuescript开源软件地址(OpenSource Url):https://github.com/pigpigyyy/Yuescript开源编程语言(OpenSource Language):C 43.3%开源软件介绍(OpenSource Introduction):YueScriptYuescript is a Moonscript dialect. It is derived from Moonscript language 0.5.0 and continuously adopting new features to be more up to date. Moonscript is a language that compiles to Lua. Since original Moonscript has been used to write web framework lapis and run a few business web sites like itch.io and 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. So 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. Yue (月) is the name of moon in Chinese and it's pronounced as [jyɛ]. Features
Installation & Usage
Build > make shared LUAI=/usr/local/include/lua LUAL=/usr/local/lib/lua Then get the binary file from path Or you can install luarocks, a package manager for Lua modules. Then install it as a Lua module with > luarocks install yuescript Then require the Yuescript module in Lua: require("yue")("main") -- require `main.yue`
local yue = require("yue")
local codes, err, globals = yue.to_lua([[
f = ->
print "hello world"
f!
]],{
implicit_return_root = true,
reserve_line_number = true,
lint_global = true
})
Clone this repo, then build and install executable with: > make install Build Yuescript tool without macro feature: > make install NO_MACRO=true Build Yuescript tool without built-in Lua binary: > make install NO_LUA=true Use Yuescript tool with: > yue -h
Usage: yue [options|files|directories] ...
-h Print this message
-e str Execute a file or raw codes
-t path Specify where to place compiled files
-o file Write output to file
-s Use spaces in generated codes instead of tabs
-m Generate minified codes
-p Write output to standard out
-b Dump compile time (doesn't write output)
-l Write line numbers from source codes
-v Print version
-- Read from standard in, print to standard out
(Must be first and only argument)
Execute without options to enter REPL, type symbol '$'
in a single line to start/stop multi-line mode Use cases: Editor Support
LicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论