onyxlang 简单试用
以前简单说过onyxlang 是一个基于webassembly 的新编程语言,以下是一个简单试用
安装
sh <(curl https://get.onyxlang.io -sSfL)
效果
注意安装完成之后需要配置环境变量(有提示)
包含的cli
Onyx toolchain version v0.1.8
Built on Wed Nov 29 01:49:11 2023
Runtime: wasmer
The toolchain for the Onyx programming language, created by Brendan Hansen.
Usage:
onyx <subcommand>
Subcommands:
help Shows this help message. Use "onyx help <subcommand>".
build Compiles an Onyx program into an executable.
run Compiles and runs an Onyx program, all at once.
check Checks syntax and types of an Onyx program.
package Package manager
version Prints version information
使用
- vs code 编辑器支持
以前也简单说过onyxlang包含了包管理,编辑器支持,比如我使用vs code 的
- 简单代码
app.onyx
use core { printf }
main :: () {
// Inferred variable type
x := 10;
// Function with entirely inferred types.
change_value :: x => x + 10;
// Onyx figures out the types of `change_value` when you call it.
printf("The value is {}.\n", change_value(x));
}
- 构建
onyx build -V -r wasi -DWASIX -o site.wasm app.onyx
- 运行
可以直接使用onyx 或者使用,wasmer runtime
onyx 模式
onyx run app.onyx
wasmer runtime
wasmer site.wasm
说明
以上是一个简单的试用,实际上onyx 目前来看还是很强大的,而且支持c-ffi 进行c 库调用
参考资料
https://onyxlang.io/
https://github.com/onyx-lang/onyx
https://wasmer.io/
https://docs.onyxlang.io/book/Overview.html
https://github.com/wasmerio/wasmer
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2023-01-09 dremio cloud 参考架构
2022-01-09 使用juicefs 做为dremio 的分布式存储
2021-01-09 graphjin 试用
2020-01-09 nodejs fork 子进程创建任务以及简单的prometheus 监控
2019-01-09 Singer 学习十三 发现模式
2019-01-09 Singer 学习十二 指南
2019-01-09 Singer 学习十一 配置以及状态管理