Replies: 1 comment 3 replies
-
The
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The compilation command for V language code is:
Default output is GC:
GC only (default):
v xxx.v
You can automatically insert 90%~100% of memory free() code during compilation, and manage the remaining 0%~10% through GC:
Autofree (-autofree):
v -autofree xxx.v
You can use arena to manage memory:
Arena (-prealloc):
v -prealloc xxx.v
You can disable GC and manually manage memory:
Manual (-gc none)
v -gc none xxx.v
You can disable GC and only use autofree to manage freed memory:
Just autofree (-autofree -gc none)
v -autofree -gc none xxx.v
The cross-compilation command for V language is:
v -os=target_operating_system -arch=target_architecture source_file.v
v -os=windows -arch=amd64 xxx.v
Compile to C, then use emscripten or similar to create the WASM code.
Default output is WASI:
v -b wasm xxx.v
You can also be explicit with:
v -b wasm -os wasi xxx.v
If you want WASM for the browser, use:
v -b wasm -os browser xxx.v
If you want WASM and disable GC and only use autofree to manage freed memory, use:
v -b wasm -autofree -gc none xxx.v
Beta Was this translation helpful? Give feedback.
All reactions