Only this pageAll pages
Powered by GitBook
1 of 12

Graf

Loading...

Tools

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

gc-as

NAME

gc-as - the Graph Code assembler

SYNOPSIS

gc-as [input] [-o <output>] [options]

DESCRIPTION

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.

OPTIONS

  • -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.

EXIT STATUS

On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

Graph Code

https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues

gc-chk

NAME

gc-chk - the Graph Code checker

SYNOPSIS

gc-chk [input] [options]

DESCRIPTION

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.

OPTIONS

  • -h, --help: Print usage information and exit.

  • -v, --version: Print version information and exit.

EXIT STATUS

On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

gc-dot

NAME

gc-dot - the Graph Code visualizer

SYNOPSIS

gc-dot [input] [-o <output>] [options]

DESCRIPTION

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.

OPTIONS

  • -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.

EXIT STATUS

On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

EXAMPLES

  • Visualize textual Graph Code: gc-as main.gc -o - | gc-dot | xdot

  • Visualize a Graph Code module: gc-dot main.gcm -o - | xdot

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

gc-cc

NAME

gc-cc - the Graf-based C compiler

SYNOPSIS

gc-cc [input] [-s <standard>] [-p] [-e] [-i <include>] [-o <output>] [options]

DESCRIPTION

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.

OPTIONS

  • -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.

EXIT STATUS

On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

  • C89

  • C99

  • C11

  • C17

  • C23

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

gc-dis

NAME

gc-dis - the Graph Code disassembler

SYNOPSIS

gc-dis [input] [-o <output>] [options]

DESCRIPTION

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.

OPTIONS

  • -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.

EXIT STATUS

On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

Graph Code

DOT

Graph Code

Graph Code .

Graph Code

https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
https://graphviz.org/doc/info/lang.html
https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues

Home

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.

gc-mc

NAME

gc-mc - the Graph Code compiler

SYNOPSIS

gc-mc [input] [-o <output>] [options]

DESCRIPTION

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.

OPTIONS

  • -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.

EXIT STATUS

On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

Graph Code is based on the , 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 . 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.

COFF

ELF

Graph Code

Mach-O

SPIR-V

WebAssembly

RVSDG
e-graphs and equality saturation
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
https://man7.org/linux/man-pages/man5/elf.5.html
https://docs.vezel.dev/graf/gc
https://github.com/aidansteele/osx-abi-macho-file-format-reference
https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html
https://webassembly.github.io/spec/core/binary/index.html
https://github.com/vezel-dev/graf/issues

gc-fmt

NAME

gc-fmt - the Graph Code formatter

SYNOPSIS

gc-fmt [inputs...] [-c] [options]

DESCRIPTION

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.

OPTIONS

  • -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.

EXIT STATUS

On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

Graph Code

https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues

gc-ld

NAME

gc-ld - the Graph Code linker

SYNOPSIS

gc-ld [inputs...] [-o <output>] [options]

DESCRIPTION

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.

OPTIONS

  • -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).

EXIT STATUS

On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

gc-opt

NAME

gc-opt - the Graph Code optimizer

SYNOPSIS

gc-opt [input] [-o <output>] [options]

DESCRIPTION

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.

OPTIONS

  • -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).

EXIT STATUS

On success, the exit code will be 0. If an error occurs, the exit code will be non-zero.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

EXAMPLES

  • Optimize textual Graph Code in-place: gc-as main.gc -o - | gc-opt | gc-dis -o main.gc

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

gc-run

NAME

gc-run - the Graph Code runner

SYNOPSIS

gc-run [input] [-i] [options] [--] [arguments...]

DESCRIPTION

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.

OPTIONS

  • -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.

EXIT STATUS

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.

ENVIRONMENT

  • NO_COLOR: If set to a non-empty value, disables colored diagnostic messages.

STANDARDS

REPORTING BUGS

COPYRIGHT

Copyright © Vezel Contributors

Graph Code

Graph Code

Graph Code

https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues
https://docs.vezel.dev/graf/gc
https://github.com/vezel-dev/graf/issues