Replies: 2 comments 3 replies
-
The
|
Beta Was this translation helpful? Give feedback.
3 replies
-
Some of this appears to have changed since this answer. It is now possible to generate a list of v files with this (which is the ctags/etags recipe):
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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