View Source Kinda.Declaration (kinda v0.11.0)

Canonical downstream entry point for Kinda's formalized declaration contract.

Consumer repos should prefer this module over reaching directly into Kinda.CodeGen.* when they need to:

  • load a generator's declaration source
  • resolve generator output into declaration surfaces
  • inspect generated NIF and type declarations

The underlying IR still lives in Kinda.CodeGen.DeclarationSurfaces, but this facade is the intended stable binding/declaration surface for downstreams.

That boundary is intentionally independent from downstream DSL naming. Repos such as Beaver can rename or consolidate their public IR, dialect, rewrite, and pass surfaces, including deleting old public shims outright, without pulling declaration resolution back out of kinda.

Summary

Types

manifest()

@type manifest() :: Kinda.CodeGen.DeclarationManifest.t()

nif_decl()

@type nif_decl() :: Kinda.CodeGen.NIFDecl.t()

source()

surfaces()

@type surfaces() :: Kinda.CodeGen.DeclarationSurfaces.t()

type_decl()

@type type_decl() :: Kinda.CodeGen.TypeDecl.t()

Functions

declaration_manifest(surfaces)

@spec declaration_manifest(surfaces()) :: manifest()

See Kinda.CodeGen.DeclarationSurfaces.declaration_manifest/1.

from_generator(mod, root_module)

@spec from_generator(module(), module()) :: surfaces()

See Kinda.CodeGen.DeclarationSurfaces.from_generator/2.

from_parts(source_declaration_manifest, declaration_manifest)

See Kinda.CodeGen.DeclarationSurfaces.from_parts/2.

load_source(mod)

See Kinda.CodeGen.DeclarationSurfaces.load_source/1.

nif_decls(surfaces)

@spec nif_decls(surfaces()) :: [nif_decl()]

See Kinda.CodeGen.DeclarationSurfaces.nif_decls/1.

signature_manifest(surfaces)

@spec signature_manifest(surfaces()) :: map() | nil

See Kinda.CodeGen.DeclarationSurfaces.signature_manifest/1.

source_declaration_manifest(surfaces)

See Kinda.CodeGen.DeclarationSurfaces.source_declaration_manifest/1.

type_decls(surfaces)

@spec type_decls(surfaces()) :: [type_decl()]

See Kinda.CodeGen.DeclarationSurfaces.type_decls/1.