From ff29c52c2f789559d93fe194418b191c4b7da791 Mon Sep 17 00:00:00 2001 From: Noy Date: Fri, 24 Sep 2021 01:04:28 -0400 Subject: [PATCH] zig: add page (#6585) --- pages/common/zig.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/common/zig.md diff --git a/pages/common/zig.md b/pages/common/zig.md new file mode 100644 index 000000000..bfb91c143 --- /dev/null +++ b/pages/common/zig.md @@ -0,0 +1,36 @@ +# zig + +> The Zig compiler and toolchain. +> More information: . + +- Compile the project in the current directory: + +`zig build` + +- Compile and run the project in the current directory: + +`zig build run` + +- Initialize a `zig build` application: + +`zig init-exe` + +- Intitialize a `zig build` library: + +`zig init-lib` + +- Create and run a test build: + +`zig test {{path/to/file.zig}}` + +- Reformat Zig source into canonical form: + +`zig fmt {{path/to/file.zig}}` + +- Use Zig as a drop-in C compiler: + +`zig cc {{path/to/file.c}}` + +- Use Zig as a drop-in C++ compiler: + +`zig c++ {{path/to/file.cpp}}`