Skip to content

Language record

Zig

Zig is indexed around the decision that actually matters: a container declaration's right-hand side decides whether it is a struct, union, enum, opaque or error set, and @import is recorded from every shape that can spell one.

.zig · 1 registry id · 8 of 14 relationship types

The registry row this page is generated from

Read at render time from the same family row the register reads, so nothing in this block can disagree with it.

Extensions
.zig
Registry names
zig
Recorded symbols
functions · structs · enums · constants

Relationship types this analyzer constructs

8 of 14 constructed, read from this analyzer's source and re-derived by the languages gate. Each row below is one of the engine's types, in the engine's own order.

Relationship typeConstructed
callsconstructed by this analyzer
extendsruled absent
implementsruled absent
usesconstructed by this analyzer
importsconstructed by this analyzer
exportsconstructed by this analyzer
containsconstructed by this analyzer
referencesconstructed by this analyzer
overridesruled absent
instantiatesconstructed by this analyzer
decoratesruled absent
rendersruled absent
mixes_inconstructed by this analyzer
part_ofruled absent

8 constructed, 6 not constructed. All 6 absent types are recorded as ruled absent: the written reason and the corpus measurement behind each are in this family's completeness record. The register explains what each label means.

What this analyzer does not resolve

  • Zig has no class inheritance, so there is no extends, implements or override edge. Composition is a field named after the other type and usingnamespace mixes names into a scope — neither is a subtype relation, and neither is recorded as one.
  • A builtin call publishes no call edge: @intCast and friends are compile-time intrinsics with no declaration in any repository behind them, so there is nothing for an edge to point at.
  • Instantiation is recorded only for a type declared in the same file, so ArrayList(u8) over a standard-library type records nothing at all rather than a construction with an unresolvable target.

Every line above was written against Zig’s own analyzer module and is named against a construct in it, so it can be checked against the source. Nothing here is inherited from a template, or from another language’s page.

Where you meet it in a repository

Recognised by extension — .zig. Everything below is about where those files actually sit in a working repository.

  • A build.zig at the root of a Zig project is a program, not only configuration, so its statements are part of the build graph.
  • Generic code is written once and monomorphised, so one body is written against several concrete types.
  • Almost everything in the standard library arrives through a single @import("std"), so a file's dependency usually terminates at the standard library rather than at a symbol.

Questions this index answers

Phrased as retrievals, because that is what an index can honestly do: it holds the symbols and the edges between them, and hands them back with the evidence attached.

  1. Which fields does this struct carry?
  2. Which modules does this file import from?
  3. Which functions are declared inside this container?
  4. Which error set members does this function declare?

What the analyzer sees in code like this

A struct with a method, an error set, and a module import
pub const Point = struct {          // bb records: struct Point · property x
    x: f64,
    pub fn norm(self: Point) f64 { return @sqrt(self.x * self.x); }
};

pub const Err = error{ NotFound };     // bb records: enum Err · member NotFound

const std = @import("std");            // bb records: an import of "std"

Symbols are stored with the file they came from and the bytes they span, so a hit points at a line rather than at a guess. The annotations in the sample are commentary for the reader, not strings the index would store.

Languages that turn up in the same repository

Application & systems — the count beside each name is how many relationship types that family’s analyzer constructs.

The extensions, registry names, recorded symbols and relationship types above are the parser registry row for Zig, read while the page rendered — the same row the register reads, so the two surfaces cannot tell two stories. Every relationship type listed as constructed appears in src/ast/real-*, the analyzer modules bb ships. bb 0.1.0 answers from a local store over 50 languages (53 registry ids, three of them aliases). There is no benchmark on this page: every claim here is one you can go and read in the source.