mirror of
https://github.com/vlang/v.git
synced 2025-09-09 07:15:50 -04:00
help: make find vlib/v/help/ -name *.txt |xargs v check-md
pass as well
This commit is contained in:
parent
29b035bd01
commit
30dbda6e65
@ -34,13 +34,18 @@ see also `v help build`.
|
||||
slightly (~10% for gcc), but sometimes provides better error diagnosis.
|
||||
|
||||
-cmain <MainFunctionName>
|
||||
Useful with framework like code, that uses macros to re-define `main`, like SDL2 does for example.
|
||||
Useful with framework like code, that uses macros to re-define `main`,
|
||||
like SDL2 does for example.
|
||||
With that option, V will always generate:
|
||||
`int MainFunctionName(int ___argc, char** ___argv) {` , for the program entry point function, *no matter* the OS.
|
||||
`int MainFunctionName(int ___argc, char** ___argv) {`
|
||||
... for the program entry point function, *no matter* the OS.
|
||||
Without it, on non Windows systems, it will generate:
|
||||
`int main(int ___argc, char** ___argv) {`
|
||||
... and on Windows, it will generate:
|
||||
a) `int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, LPWSTR cmd_line, int show_cmd){`
|
||||
a) `int WINAPI wWinMain( HINSTANCE instance,
|
||||
HINSTANCE prev_instance,
|
||||
LPWSTR cmd_line,
|
||||
int show_cmd){`
|
||||
when you are compiling applications that `import gg`.
|
||||
... or it will generate:
|
||||
b) `int wmain(int ___argc, wchar_t* ___argv[], wchar_t* ___envp[]){`
|
||||
@ -61,10 +66,12 @@ see also `v help build`.
|
||||
bare_eprint(buf &byte, len u64)
|
||||
Print len characters from the buffer pointed to by buf to stderr.
|
||||
bare_panic(msg string)
|
||||
Print "V panic: " + msg, along with an optional backtrace and/or the V commit hash, and then exit.
|
||||
Print "V panic: " + msg, along with an optional backtrace
|
||||
and/or the V commit hash, and then exit.
|
||||
[export: 'malloc']
|
||||
__malloc(n usize) &C.void
|
||||
Allocates n bytes of memory and returns the pointer to the first byte
|
||||
Allocates n bytes of memory and returns the pointer to the first
|
||||
byte.
|
||||
[export: 'free']
|
||||
__free(ptr &C.void)
|
||||
Free the block of memory ptr allocated by malloc.
|
||||
@ -212,17 +219,18 @@ see also `v help build`.
|
||||
|
||||
-compress
|
||||
Compress the compiled executable with UPX.
|
||||
Note: `upx` should be installed beforehand.
|
||||
In most Linux distros it is in a package named `upx-ucl`.
|
||||
On macOS, you can install it with `brew install upx`.
|
||||
On Windows, you can download it from https://upx.github.io/ .
|
||||
Note: `upx` should be installed beforehand.
|
||||
In most Linux distros it is in a package named `upx-ucl`.
|
||||
On macOS, you can install it with `brew install upx`.
|
||||
On Windows, you can download it from https://upx.github.io/ .
|
||||
|
||||
-live
|
||||
Build the executable with live capabilities (`[live]`).
|
||||
|
||||
-no-preludes
|
||||
Prevents V from generating a prelude in generated .c files, useful for freestanding targets
|
||||
where eg. you replace C standard library with your own, or some definitions/headers break something.
|
||||
where eg. you replace C standard library with your own, or some definitions/headers
|
||||
break something.
|
||||
|
||||
-custom-prelude <path>
|
||||
Useful for similar use-case as above option, except it replaces V-generated prelude with
|
||||
@ -309,4 +317,4 @@ see also `v help build`.
|
||||
that use relatively few threads.
|
||||
It may be decreased, to reduce the memory footprint of programs that launch
|
||||
hundreds/thousands of threads, but where each of the threads does not need
|
||||
a big stack.
|
||||
a big stack.
|
||||
|
@ -15,7 +15,8 @@ pick another:
|
||||
For more general build help, see also `v help build`.
|
||||
|
||||
# Interfacing the Javascript Backend code generation, passing options to it:
|
||||
-es5 Compile V to ES5 compatible code possibly shrinking output. Note that this flag might limit some types capabilities.
|
||||
-es5 Compile V to ES5 compatible code possibly shrinking output.
|
||||
Note that this flag might limit some types capabilities.
|
||||
-prod
|
||||
Do not create any JS Doc comments
|
||||
|
||||
@ -32,4 +33,4 @@ For more general build help, see also `v help build`.
|
||||
(default false, all files in the source map are currently referenced by
|
||||
their absolute system file path)
|
||||
|
||||
The supported targets for the JS backend are: ES6 strict
|
||||
The supported targets for the JS backend are: ES6 strict
|
||||
|
@ -20,10 +20,13 @@ For more general build help, see also `v help build`.
|
||||
Change the target WebAssembly execution environment that V compiles for.
|
||||
|
||||
The `wasi` target is the default execution environment.
|
||||
When targeting WASI, the generated WebAssembly module can be run in a variety of environments that support the WASI specification.
|
||||
WASI provides a standardized interface to interact with the host operating system, allowing WebAssembly modules to perform tasks like file I/O, networking, and more.
|
||||
When targeting WASI, the generated WebAssembly module can be run in a variety
|
||||
of environments that support the WASI specification.
|
||||
WASI provides a standardized interface to interact with the host operating system,
|
||||
allowing WebAssembly modules to perform tasks like file I/O, networking, and more.
|
||||
The specific version of the WASI specification targeted by V is 'wasi_snapshot_preview1'.
|
||||
|
||||
The `browser` target is an experimental environment that compiles for a stripped down builtin, for use in browsers.
|
||||
The produced WebAssembly module will have functions exported that are `pub` and inside the `module main`.
|
||||
See `examples/wasm/mandelbrot` for an example.
|
||||
The `browser` target is an experimental environment that compiles for a stripped down
|
||||
builtin, for use in browsers. The produced WebAssembly module will have functions
|
||||
exported that are `pub` and inside the `module main`. See `examples/wasm/mandelbrot`
|
||||
for an example.
|
||||
|
@ -39,13 +39,16 @@ NB: the build flags are shared with the run command too:
|
||||
Current list of supported backends:
|
||||
* `c` (default) - V outputs C source code, which is then passed to a C compiler.
|
||||
* `go` - V outputs Go source code, which is then passed to a Go compiler.
|
||||
* `interpret` - V will interpret the V program directly, instead of compiling it first. Same as `v interpret file.v`.
|
||||
* `interpret` - V will interpret the V program directly, instead of compiling it first.
|
||||
Same as `v interpret file.v`.
|
||||
* `js` - V outputs JS source code which can be passed to NodeJS to be ran.
|
||||
* `js_browser` - V outputs JS source code ready for the browser.
|
||||
* `js_node` - V outputs JS source code to run with nodejs.
|
||||
* `js_freestanding` - V outputs JS source code with no hard runtime dependency.
|
||||
* `native` - V outputs a native executable directly (see -arch x64|arm64 and -os linux|macos) (EXPERIMENTAL).
|
||||
* `wasm` - V outputs a WebAssembly module directly (see -os wasi|browser) (EXPERIMENTAL).
|
||||
* `native` - V outputs a native executable directly.
|
||||
(see -arch x64|arm64 and -os linux|macos) (EXPERIMENTAL).
|
||||
* `wasm` - V outputs a WebAssembly module directly
|
||||
(see -os wasi|browser) (EXPERIMENTAL).
|
||||
|
||||
-d <flag>[=<value>], -define <flag>[=<value>]
|
||||
Define the provided flag.
|
||||
@ -111,7 +114,8 @@ NB: the build flags are shared with the run command too:
|
||||
|
||||
NB: You can also select specific functions for profiling. For example:
|
||||
v -profile-fns println,i64_str -profile - run examples/hanoi.v
|
||||
In this case, the profile counters will be updated only for them, *and* for the functions that they call.
|
||||
In this case, the profile counters will be updated only for them,
|
||||
*and* for the functions that they call.
|
||||
The profile result (after the program finishes), will look similar to this:
|
||||
127 0.721ms 5680ns println
|
||||
127 0.693ms 5456ns _writeln_to_fd
|
||||
@ -213,4 +217,4 @@ For Native-specific build flags, use `v help build-native`.
|
||||
For WebAssembly-specific build flags, use `v help build-wasm`.
|
||||
|
||||
See also:
|
||||
`v help run` for documentation regarding `v run`.
|
||||
`v help run` for documentation regarding `v run`.
|
||||
|
@ -7,7 +7,8 @@ Commonly Used Commands:
|
||||
fmt Formats the given V source files or recursively formats all files in the directory,
|
||||
then prints their formatted source to stdout.
|
||||
|
||||
missdoc Prints all V functions in .v files under PATH/, that do not yet have documentation comments.
|
||||
missdoc Prints all V functions in .v files under PATH/, that do not yet have documentation
|
||||
comments.
|
||||
|
||||
repl Run the V REPL
|
||||
|
||||
@ -21,4 +22,4 @@ Commonly Used Commands:
|
||||
then when any of the .v source files change,
|
||||
it re-runs the complication
|
||||
|
||||
where Prints the location of the searched symbols in the scope of the current project
|
||||
where Prints the location of the searched symbols in the scope of the current project
|
||||
|
@ -2,7 +2,8 @@ Other less frequently used commands supported by V include:
|
||||
|
||||
ast Generate a json representation of the AST for a given .v file.
|
||||
|
||||
bug Post an issue on the V's issue tracker, including the failing program, and some diagnostic information.
|
||||
bug Post an issue on the V's issue tracker, including the failing program,
|
||||
and some diagnostic information.
|
||||
|
||||
bin2v Convert a binary file to a v source file,
|
||||
that can be later embedded in a module or program.
|
||||
@ -42,4 +43,5 @@ Other less frequently used commands supported by V include:
|
||||
test-self Test if V is working properly by running all tests, including the compiler ones.
|
||||
NB: this can take 1-2 minutes to run.
|
||||
|
||||
wipe-cache Remove the V cache folder. Useful for cleaning the cache, and guaranteeing a clean build.
|
||||
wipe-cache Remove the V cache folder. Useful for cleaning the cache, and guaranteeing a
|
||||
clean build.
|
||||
|
Loading…
x
Reference in New Issue
Block a user