mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
These AST nodes now have a flags field and then a bunch of optional trailing objects. The end result is lower memory usage and consequently better performance. This is part of an ongoing effort to reduce the amount of memory parsed ASTs take up. Running `zig fmt` on the std lib: * cache-misses: 2,554,321 => 2,534,745 * instructions: 3,293,220,119 => 3,302,479,874 * peak memory: 74.0 MiB => 73.0 MiB Holding the entire std lib AST in memory at the same time: 93.9 MiB => 88.5 MiB
A general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
Resources
- Introduction
- Download & Documentation
- Community
- Contributing
- Frequently Asked Questions
- Community Projects
Building from Source
Note that you can download a binary of master branch.
Stage 1: Build Zig from C++ Source Code
Dependencies
POSIX
- cmake >= 2.8.5
- gcc >= 5.0.0 or clang >= 3.6.0
- LLVM, Clang, LLD development libraries == 10.x, compiled with the same gcc or clang version above
- Use the system package manager, or build from source.
Windows
- cmake >= 3.15.3
- Microsoft Visual Studio. Supported versions:
- 2015 (version 14)
- 2017 (version 15.8)
- 2019 (version 16)
- LLVM, Clang, LLD development libraries == 10.x
- Use the pre-built binaries or build from source.
Instructions
POSIX
mkdir build
cd build
cmake ..
make install
Need help? Troubleshooting Build Issues
MacOS
brew install cmake llvm
brew outdated llvm || brew upgrade llvm
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix llvm)
make install
You will now run into this issue:
homebrew and llvm 10 packages in apt.llvm.org are broken with undefined reference to getPollyPluginInfo
or
error: unable to create target: 'Unable to find target for this triple (no targets are registered)',
in which case try -DZIG_WORKAROUND_4799=ON
Hopefully this will be fixed upstream with LLVM 10.0.1.
Windows
See https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows
Languages
Zig
98.3%
C
1.1%
C++
0.2%
Python
0.1%