crow/version.crow
(source)
Results of functions in this module are known at compile-time.
For example, given a conditional if is-single-threaded
, functions in the unused branch
(the false
branch on Windows, and the true
branch on other OSes)
will not be included in the compiled executable.
This is important to avoid the compiler attempting to link to functions
that don't exist on a machine.
Code is always typechecked regardless of whether it will be used.
is-stack-trace-enabled
bool
() bare
, unsafe
This will be true unless the program was run with '--no-stack-trace'.
When this is true, Crow will collect a stack trace when an exception is thrown.
is-single-threaded
bool
() bare
, unsafe
This will be true if is-wasm
or if the program was run with '--single-threaded'.
If this is true, there will only be one Crow thread.
This simplifies the runtime by letting it skip locks.
External libraries can still launch their own threads.
is-interpreted
bool
() bare
, unsafe
True if using 'crow run' without the '--jit' or '--aot' option.
is-jit
bool
() bare
, unsafe
True if using 'crow run my-program --jit'.
is-wasm
bool
() bare
, unsafe
True if the code is run in the WASM interpreter.
is-big-endian
bool
() bare
, unsafe
True if integers on this machine are big-endian.