
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Write and compile as WebAssembly program by lua script.
Note: this project is still under development. We have to do more improvement
To avoid to polute your environment, we prefer to use prebuilt docker image on https://hub.docker.com/r/ysugimoto/webassembly-lua/.
Here is example Hello World script:
luafunction hello_world() return 'Hello, WebAssembly Lua!' end
Make sure the function declares as global in order to access from C program. And, also you can spcify some function arguments like:
luafunction hell_something(something): return ('Hello, %s!'):format(something) end
Then, you need to rememeber what type of argument should be supplied and what type of value will return (supports string or int for now).
definition.ymlThe definition.yml is configuration for generate / compile WebAssembly ***ary. Format is following:
yamldependencies: - luaposix functions: hello_something: return : string args: - string entry_file: hello_world.lua
Describes each fields:
| Field | Type | Default | description |
|---|---|---|---|
| dependencies | array | - | program dependencies. the list of modules will be installed via luarocks. |
| functions | object | - | Function definitions. The key is function name which will be exported on WASM. |
| functions[name].return | string | - | Define function return type. |
| functions[name].args | array | - | Defined function argument type list. |
| entry_file | strring | main.lua | the file name of program entry. |
On docker image, the image has emcc-lua command:
shell$ docker pull ysugimoto/webassembly-lua $ docker run --rm -v $PWD:/src ysugimoto/webassembly-lua emcc-lua
The emcc-lua finds definition.yml in current working directory (in this case, $PWD) and start to build. If build successfully, you can see a hello_world.[html,js,wasm]in your directory. The output file is named byentry_file` in definition.yml.
Open created or write HTML to run compiled WebAssembly program like:
CODE_TOKEN_4
And run local server in your favorite way (e.g python -m http.server) and access to http://localhost:8000/hello_world.html (port may need), then you can see Hello, WebAssembly Lua! message in your browser console.
luaposix, it's fine to work)Yoshiaki Sugimoto
MIT
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务