Socket
Book a DemoInstallSign in
Socket

ziglang

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ziglang

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

pipPyPI
Version
0.15.1
Maintainers
2

Zig PyPI distribution

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. The ziglang Python package redistributes the Zig toolchain so that it can be used as a dependency of Python projects.

Rationale

Although Zig is useful in itself, the Zig toolchain includes a drop-in C and C++ compiler, zig cc, based on clang. Unlike clang itself, zig cc is standalone: it does not require additional development files to be installed to target any of the platforms it supports. Through zig cc, Python code that generates C or C++ code can build it without any external dependencies.

Usage

To run the Zig toolchain from the command line, use:

python -m ziglang

To run the Zig toolchain from a Python program, use sys.executable to locate the Python binary to invoke. For example:

import sys, subprocess

subprocess.call([sys.executable, "-m", "ziglang"])

Binary wrapper

The ziglang Python package installs a binary wrapper for the Zig compiler under the name python-zig; the name is different to avoid conflicts with any system-wide or user-wide zig binaries that may be already installed.

Using with uv

The Zig compiler distributed in this Python package can be launched by uv without installation:

uvx --from ziglang python-zig

License

The Zig license.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts