Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zztkm/hello-onyx
https://github.com/zztkm/hello-onyx
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zztkm/hello-onyx
- Owner: zztkm
- Created: 2023-12-13T00:13:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-17T05:35:14.000Z (about 1 year ago)
- Last Synced: 2024-12-20T23:29:50.321Z (14 days ago)
- Language: Makefile
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hello Onyx !
## Onyx commands
### help
```
❯ onyx help
Onyx toolchain version v0.1.8
Built on Wed Nov 29 01:48:14 2023
Runtime: wasmerThe toolchain for the Onyx programming language, created by Brendan Hansen.
Usage:
onyxSubcommands:
help Shows this help message. Use "onyx help ".
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.
watch Continuously rebuilds an Onyx program on file changes.
package Package manager
version Prints version information
```### Run program
```bash
onyx run main.onyx
```### Build program
```bash
$ onyx build main.onyx$ ls
main.onyx out.wasm# そのまま wasmer で実行できると思ったけどだめだった
$ wasmer run out.wasm
error: Unable to compile "out.wasm"
╰─▶ 1: WebAssembly translation error: Error when converting wat: input bytes aren't valid utf-8
````onyx help build` を見たところ、runtime に wasi を指定してやる必要がありそう(onyx, wasi, js, custom が指定可能、default は onyx)。
```bash
$ onyx build --runtime wasi -o wasi.wasm main.onyx$ wasmer run wasi.wasm
hello onyx!%
```### Check program
```bash
onyx check main.onyx
```エラーがあれば、エラー内容が表示される。
```bash
(/home/zztkm/dev/sandbox/onyx/hello/main.onyx:5,1) expected token ';', got '}'.
5 | }
```### Watch program
web server 書いたり、ゲーム書いたりしてるときに便利そう。
```bash
onyx watch main.onyx
```