Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
gc-chk
- the Graph Code checker
gc-chk [input] [options]
gc-chk
runs an exhaustive set of validity checks on a Graph Code module. This can be useful, for example, to verify the correctness of module writing code or optimizations/transformations.
Note that the Graf library and other Graf tools generally assume that input Graph Code already passes the validity checks performed by gc-chk
.
If the input file name is omitted or it is set to -
, then input is read from standard input.
Any diagnostic messages are written to standard error.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
Graph Code https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
Copyright © Vezel Contributors
This is currently in-development vaporware.
Graf is a graph-oriented compiler infrastructure written in Zig. Chiefly, it provides the Graph Code intermediate representation, a simple optimization framework, and a machine code generator.
Graph Code is based on the RVSDG, a novel IR that has a number of desirable properties such as explicit data and state dependencies, inherent static-single assignment form, strong canonicalization, and whole-program representation.
Optimization is primarily based on e-graphs and equality saturation. In addition to being a natural fit for the RVSDG, this results in a cohesive framework for discovering rewrites and losslessly adding them to the IR, thus avoiding the phase-ordering problem.
gc-dot
- the Graph Code visualizer
gc-dot [input] [-o <output>] [options]
gc-dot
assists in visualizing a Graph Code module by generating a graph in the Graphviz DOT language.
If the input file name is omitted or it is set to -
, then input is read from standard input.
If the -o
option is not specified, then the output method is selected according to these rules:
If the input is read from standard input, then the output is written to standard output.
If the input is a file name, then the output is written to the same file name but with the extension changed to .dot
.
Any diagnostic messages are written to standard error.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
-o, --output <output>
: Set the output file name. If set to -
, then output is written to standard output.
On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
Graph Code https://docs.vezel.dev/graf/gc
Visualize textual Graph Code: gc-as main.gc -o - | gc-dot | xdot
Visualize a Graph Code module: gc-dot main.gcm -o - | xdot
https://github.com/vezel-dev/graf/issues
Copyright © Vezel Contributors
gc-dis
- the Graph Code disassembler
gc-dis [input] [-o <output>] [options]
gc-dis
disassembles a Graph Code module into textual Graph Code.
If the input file name is omitted or it is set to -
, then input is read from standard input.
If the -o
option is not specified, then the output method is selected according to these rules:
If the input is read from standard input, then the output is written to standard output.
If the input is a file name, then the output is written to the same file name but with the extension changed to .gc
.
Any diagnostic messages are written to standard error.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
-o, --output <output>
: Set the output file name. If set to -
, then output is written to standard output.
On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
Graph Code https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
Copyright © Vezel Contributors
gc-opt
- the Graph Code optimizer
gc-opt [input] [-o <output>] [options]
gc-opt
loads a Graph Code module, optimizes it, and outputs the resulting module.
If the input file name is omitted or set to -
, then input is read from standard input.
If the -o
option is not specified, then the output is written to standard output.
Any diagnostic messages are written to standard error.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
-o, --output <output>
: Set the output file name. If set to -
, then output is written to standard output (equivalent to omitting the option).
On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
Optimize textual Graph Code in-place: gc-as main.gc -o - | gc-opt | gc-dis -o main.gc
Copyright © Vezel Contributors
gc-fmt
- the Graph Code formatter
gc-fmt [inputs...] [-c] [options]
gc-fmt
formats textual Graph Code into canonical form. The canonical form is opinionated and unconfigurable.
If no input file or directory names are provided or if the only input is -
, then input is read from standard input and formatted text is written to standard output. (If -
is used, it must be the only input.) Otherwise, formatting is performed in-place to the file names given as well as any files ending in .gc
found (recursively) within any directory names given.
Any diagnostic messages are written to standard error.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
-c, --check
: Enable listing non-conforming files rather than applying formatting.
On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
Copyright © Vezel Contributors
Graph Code
Graph Code
gc-run
- the Graph Code runner
gc-run [input] [-i] [options] [--] [arguments...]
gc-run
executes a Graph Code module, either through just-in-time compilation or interpretation.
There are a number of requirements for the input module:
It must have an entry point function with a signature that is compatible with the standard C main
function.
It must be targeted for the host machine and operating system.
If it uses an external libc, it must be the same libc that gc-run
uses.
If the -i
option is specified, it can only call external functions if gc-run
is able to find and load libffi on the host machine.
Even then, there are edge cases that libffi may not be able to handle.
If the input file name is omitted or it is set to -
, then input is read from standard input.
Any arguments/options that are not recognized by gc-run
will be passed through as arguments to the executed module. --
can be used to explicitly end argument processing by gc-run
so that all subsequent arguments are passed through.
Any diagnostic messages are written to standard error.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
-i, --interpret
: Use the interpreter instead of just-in-time compilation.
If the given module fails to load or execute in some way, the exit code will be non-zero. Otherwise, the exit code will be whatever is returned by the module.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
Graph Code https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
Copyright © Vezel Contributors
gc-mc
- the Graph Code compiler
gc-mc [input] [-o <output>] [options]
gc-mc
compiles a Graph Code module into machine code.
If the input file name is omitted or set to -
, then input is read from standard input.
If the -o
option is not specified, then the output method is selected according to these rules:
If the input is read from standard input, then the output is written to standard output.
If the input is a file name, then the output is written to the same file name but with the extension changed to .obj
(for COFF), .spv
(for SPIR-V), or .o
(for all other formats).
Any diagnostic messages are written to standard error.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
-o, --output <output>
: Set the output file name. If set to -
, then output is written to standard output.
On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
Graph Code https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
Copyright © Vezel Contributors
gc-cc
- the Graf-based C compiler
gc-cc [input] [-s <standard>] [-p] [-e] [-i <include>] [-o <output>] [options]
gc-cc
compiles C code using the Aro C compiler frontend and the Graf compiler infrastructure. C89 through C23 are supported.
Note that gc-cc
is primarily used as a way to field-test the Graf compiler infrastructure; it is not a production-quality C compiler in the same capacity as e.g. GCC or Clang. As such, its option spellings are slightly different than those compilers.
If the input file name is omitted or set to -
, then input is read from standard input.
If the -o
option is not specified, then the output method is selected according to these rules:
If the input is read from standard input, then the output is written to standard output.
If the input is a file name, then the output is written to the same file name but with the extension changed to .gcm
.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
-s, --standard <standard>
: Set the C language standard (c23
(default), c17
, c11
, c99
, c89
).
-p, --pedantic
: Disable C language extensions.
-e, --error
: Enable treating warnings as errors.
-d, --define <name[=value]>
: Define a macro as if #define
was used.
-u, --undefine <name>
: Undefine a macro as if #undef
was used.
-i, --include <include>
: Add a preprocessor include search path.
--isystem <include>
: Add a preprocessor include search path and consider it to contain system headers.
-t, --target <triple>
: Set the target triple. Defaults to the host machine's detected triple.
-c, --cpu <cpu>
: Set the target CPU model and features. Defaults to either baseline
or native
depending on the usage of -t
.
-o, --output <output>
: Set the output file name. If set to -
, then output is written to standard output.
On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
C89
C99
C11
C17
C23
Graph Code https://docs.vezel.dev/graf/gc.
https://github.com/vezel-dev/graf/issues
Copyright © Vezel Contributors
gc-ld
- the Graph Code linker
gc-ld [inputs...] [-o <output>] [options]
gc-ld
combines multiple Graph Code modules into a single module.
If no input file names are provided or if any input is set to -
, then input is read from standard input. File inputs and standard input can be used in the same invocation when using -
as one of the inputs. Additionally, multiple modules can be concatenated on standard input.
If the -o
option is not specified, then the output is written to standard output.
Any diagnostic messages are written to standard error.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
-o, --output <output>
: Set the output file name. If set to -
, then output is written to standard output (equivalent to omitting the option).
On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
Graph Code https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
Copyright © Vezel Contributors
gc-as
- the Graph Code assembler
gc-as [input] [-o <output>] [options]
gc-as
assembles textual Graph Code into a Graph Code module.
If the input file name is omitted or set to -
, then input is read from standard input.
If the -o
option is not specified, then the output method is selected according to these rules:
If the input is read from standard input, then the output is written to standard output.
If the input is a file name, then the output is written to the same file name but with the extension changed to .gcm
.
Any diagnostic messages are written to standard error.
-h, --help
: Print usage information and exit.
-v, --version
: Print version information and exit.
-o, --output <output>
: Set the output file name. If set to -
, then output is written to standard output.
On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.
NO_COLOR
: If set to a non-empty value, disables colored diagnostic messages.
Copyright © Vezel Contributors
Graph Code