View Source Kinda.CodeGen behaviour (kinda v0.11.0)
Behavior and macros for declaration-driven NIF module generation.
use Kinda.CodeGen requires a codec: module. Generated public wrappers
call their concrete raw NIF function and pass only its return value to
codec.normalize/1.
The default :combined surface keeps public wrappers, native stubs, and a
raw proxy module together. Large bindings can compile the :public and
:raw surfaces in separate modules to remove the proxy layer and let the
compiler process both surfaces independently.
Summary
Functions
Generates public wrappers that call functions in raw_module directly.
Generates native stubs without a public proxy layer.
Types
@type declaration_manifest() :: Kinda.CodeGen.DeclarationManifest.t()
@type declaration_manifest_source() :: Kinda.CodeGen.DeclarationManifest.source()
@type declaration_surfaces() :: Kinda.CodeGen.DeclarationSurfaces.t()
@type nif_decl_input() :: Kinda.CodeGen.NIFDecl.t() | {atom(), integer()} | {atom(), [atom()]}
@type signature_manifest() :: map() | nil
@type type_decl() :: Kinda.CodeGen.TypeDecl.t()
Callbacks
@callback declaration_manifest() :: declaration_manifest_source()
@callback kinds() :: [Kinda.CodeGen.KindDecl.t()]
Functions
Generates public wrappers that call functions in raw_module directly.
Kind-scoped declarations are omitted because they are an implementation detail of resource modules rather than part of the public wrapper surface.
Generates native stubs without a public proxy layer.
Public declarations use their wrapper name in the raw module. Kind-scoped declarations retain their fully-qualified function atoms so each resource kind remains unambiguous.