abla/compiler
Generated from source.
Import with import "abla/compiler".
Source: abla/compiler/entry.ab
compilerFunctions (extern)
compile extern:"compiler" fun compilerFunctions(): array<int>
Returns the available compilation-scoped function handles.
compilerExportedNames (extern)
compile extern:"compiler" fun compilerExportedNames(
modules: array<string>
): array<string>
Sorted, unique annotation C names in these exact reflected module identities. An empty module set selects the whole loaded graph. Includes @export, @exportChecked and @exportLocal, whether or not a function is reachable.
Compiler.exportedNames (extension compile.fun)
compile fun Compiler.exportedNames(modules: array<string>): array<string>
Returns sorted, unique C export names for the given module identities, or for the entire graph when modules is empty.
compilerBindings (extern)
compile extern:"compiler" fun compilerBindings(): array<int>
Top-level binding handles use the same compilation-scoped declaration domain as function and class handles.
compilerFindBinding (extern)
compile extern:"compiler" fun compilerFindBinding(name: string): int
Returns the handle of the last top-level binding named name, or -1 if none exists.
compilerBindingName (extern)
compile extern:"compiler" fun compilerBindingName(handle: int): string
Returns the name of a top-level binding, reporting a compile-time error for an invalid handle.
compilerBindingIsDelegated (extern)
compile extern:"compiler" fun compilerBindingIsDelegated(handle: int): bool
Returns whether the binding uses by, reporting a compile-time error for an invalid handle.
compilerBindingExposedType (extern)
compile extern:"compiler" fun compilerBindingExposedType(handle: int): string
Returns the source-visible type of the binding's value, reporting a compile-time error for an invalid handle.
compilerBindingDelegateType (extern)
compile extern:"compiler" fun compilerBindingDelegateType(handle: int): string
Returns the source-visible type of the delegate, or an empty string for an ordinary binding, and rejects invalid handles.
compilerBindingIsMutable (extern)
compile extern:"compiler" fun compilerBindingIsMutable(handle: int): bool
Returns whether the binding was declared with var, reporting a compile-time error for an invalid handle.
compilerBindingGetter (extern)
compile extern:"compiler" fun compilerBindingGetter(handle: int): int
Returns the delegate's getValue handle or -1 when unavailable, and rejects invalid binding handles.
compilerBindingSetter (extern)
compile extern:"compiler" fun compilerBindingSetter(handle: int): int
Returns the delegate's setValue handle or -1 when unavailable, and rejects invalid binding handles.
compilerBindingCanReplaceDelegate (extern)
compile extern:"compiler" fun compilerBindingCanReplaceDelegate(
handle: int
): bool
Returns whether the binding is both delegated and mutable, reporting a compile-time error for an invalid handle.
compilerBindingByBegin (extern)
compile extern:"compiler" fun compilerBindingByBegin(handle: int): int
Returns the first source byte offset of the by expression, or -1 for an ordinary binding, and rejects invalid handles.
compilerBindingByEnd (extern)
compile extern:"compiler" fun compilerBindingByEnd(handle: int): int
Returns the exclusive end byte offset of the by expression, or -1 for an ordinary binding, and rejects invalid handles.
compilerFunctionsAnnotated (extern)
compile extern:"compiler" fun compilerFunctionsAnnotated(
annotation: string
): array<int>
Returns top-level functions carrying the exact annotation. Generated declarations remain eligible; nominal and extension methods are excluded so every returned handle is valid for top-level artifact roots.
compilerFindFunction (extern)
compile extern:"compiler" fun compilerFindFunction(name: string): int
Returns -1 when no function has this name.
compilerFunctionName (extern)
compile extern:"compiler" fun compilerFunctionName(handle: int): string
Returns the function's source name or reports a compile-time error for an invalid handle.
compilerFunctionCanonicalIdentity (extern)
compile extern:"compiler" fun compilerFunctionCanonicalIdentity(
handle: int
): string
Returns the compiler's canonical function identity, with the owning type for methods, and rejects invalid handles.
compilerFunctionModuleIdentity (extern)
compile extern:"compiler" fun compilerFunctionModuleIdentity(
handle: int
): string
Returns the declaring module's identity or reports a compile-time error for an invalid function handle.
compilerFunctionOwner (extern)
compile extern:"compiler" fun compilerFunctionOwner(handle: int): string
Empty for a top-level function, otherwise the canonical receiver type.
compilerFunctionParameterCount (extern)
compile extern:"compiler" fun compilerFunctionParameterCount(handle: int): int
Returns the number of declared parameters or reports a compile-time error for an invalid function handle.
compilerFunctionParameterName (extern)
compile extern:"compiler" fun compilerFunctionParameterName(
handle: int,
parameter: int
): string
Returns the name of the zero-based parameter, reporting a compile-time error for an invalid handle or index.
compilerFunctionParameterType (extern)
compile extern:"compiler" fun compilerFunctionParameterType(
handle: int,
parameter: int
): string
Returns the normalized source-visible type of the zero-based parameter, reporting a compile-time error for an invalid handle or index.
compilerFunctionResultType (extern)
compile extern:"compiler" fun compilerFunctionResultType(handle: int): string
Returns the reflected result type as source-visible text or reports a compile-time error for an invalid function handle.
compilerTypeModuleIdentity (extern)
compile extern:"compiler" fun compilerTypeModuleIdentity(handle: int): string
Returns the reflected type's canonical module prefix, which may be empty, and reports a compile-time error for an invalid type handle.
compilerFunctionAnnotationCount (extern)
compile extern:"compiler" fun compilerFunctionAnnotationCount(
handle: int
): int
Returns the number of annotations attached to the function or reports a compile-time error for an invalid handle.
compilerFunctionAnnotation (extern)
compile extern:"compiler" fun compilerFunctionAnnotation(
handle: int,
annotation: int
): string
Returns the annotation name at the zero-based index, reporting a compile-time error for an invalid function handle or index.
compilerFunctionAnnotationArgumentCount (extern)
compile extern:"compiler" fun compilerFunctionAnnotationArgumentCount(
handle: int,
annotation: int
): int
The argument of annotation annotation: @route("/users") has one (count 1), a bare @marker none. Kind is the syntax kind (string, integer, true, false, array, ...); text is a literal's value.
compilerFunctionAnnotationArgumentKind (extern)
compile extern:"compiler" fun compilerFunctionAnnotationArgumentKind(
handle: int,
annotation: int,
argument: int
): string
Returns the syntax kind of annotation argument zero, reporting a compile-time error for an invalid handle, annotation, or argument.
compilerFunctionAnnotationArgumentText (extern)
compile extern:"compiler" fun compilerFunctionAnnotationArgumentText(
handle: int,
annotation: int,
argument: int
): string
Returns the syntax text of annotation argument zero, reporting a compile-time error for an invalid handle, annotation, or argument.
compilerFunctionIsCompileOnly (extern)
compile extern:"compiler" fun compilerFunctionIsCompileOnly(handle: int): bool
Returns whether the handle names a compile fun, reporting a compile-time error for an invalid handle.
compilerFunctionIsTrusted (extern)
compile extern:"compiler" fun compilerFunctionIsTrusted(handle: int): bool
Returns whether the function is declared trusted, reporting a compile-time error for an invalid handle.
compilerFunctionIsExternal (extern)
compile extern:"compiler" fun compilerFunctionIsExternal(handle: int): bool
Returns whether the function is declared extern, reporting a compile-time error for an invalid handle.
compilerFindClass (extern)
compile extern:"compiler" fun compilerFindClass(name: string): int
Finds class name and returns its compilation-scoped handle, or -1 when absent.
compilerClassTypeParameterCount (extern)
compile extern:"compiler" fun compilerClassTypeParameterCount(handle: int): int
Returns the number of generic type parameters, or zero for an invalid declaration handle.
compilerClassTypeParameterName (extern)
compile extern:"compiler" fun compilerClassTypeParameterName(handle: int, index: int): string
Returns the zero-based generic type parameter name, or an empty string for an invalid handle or index.
compilerContractFunctionsAnnotated (extern)
compile extern:"compiler" fun compilerContractFunctionsAnnotated(annotation: string): array<int>
Functions an import contract brought, by annotation: signatures only.
compilerClassFieldCount (extern)
compile extern:"compiler" fun compilerClassFieldCount(handle: int): int
Returns the count of declared val and var fields of the class identified by handle.
compilerClassFieldName (extern)
compile extern:"compiler" fun compilerClassFieldName(
handle: int,
field: int
): string
Returns the source name of zero-based field on class handle, counting only declared val and var fields.
compilerClassFieldType (extern)
compile extern:"compiler" fun compilerClassFieldType(
handle: int,
field: int
): string
Returns the normalized type of zero-based field on class handle. Delegated properties report their exposed type.
compilerClassFieldIsMutable (extern)
compile extern:"compiler" fun compilerClassFieldIsMutable(
handle: int,
field: int
): bool
Returns whether the indexed declared field is a var, reporting a compile-time error for an invalid class handle or field index.
compilerClassFieldIsDelegated (extern)
compile extern:"compiler" fun compilerClassFieldIsDelegated(
handle: int,
field: int
): bool
A delegated property (var balance: int by Box(0)): compilerClassFieldType is the type it reads as, compilerClassFieldDelegateType its delegate's.
compilerClassFieldDelegateType (extern)
compile extern:"compiler" fun compilerClassFieldDelegateType(
handle: int,
field: int
): string
Returns the indexed field's delegate type or an empty string for an ordinary field, and rejects invalid class handles and field indices.
compilerExtensionFieldCount (extern)
compile extern:"compiler" fun compilerExtensionFieldCount(handle: int): int
A class's extension fields (var Point.label: string = ""), in declaration order: the class handle is compilerFindClass's.
compilerExtensionFieldName (extern)
compile extern:"compiler" fun compilerExtensionFieldName(
handle: int,
field: int
): string
Returns the name of the indexed extension field or reports a compile-time error for an invalid class handle or field index.
compilerExtensionFieldType (extern)
compile extern:"compiler" fun compilerExtensionFieldType(
handle: int,
field: int
): string
Returns the type of the indexed extension field or reports a compile-time error for an invalid class handle or field index.
compilerExtensionFieldIsMutable (extern)
compile extern:"compiler" fun compilerExtensionFieldIsMutable(
handle: int,
field: int
): bool
Returns whether the indexed extension field is a var, reporting a compile-time error for an invalid class handle or field index.
compilerAddExtensionField (extern)
compile extern:"compiler" fun compilerAddExtensionField(
handle: int,
name: string,
type: string,
initial: string,
mutable: bool
): bool
From a transform: declares an extension field of the class (its default given as source), or removes one the transform's own module declares.
compilerRemoveExtensionField (extern)
compile extern:"compiler" fun compilerRemoveExtensionField(
handle: int,
name: string
): bool
Returns true when a transform stages removal of its own module's extension field, and rejects requests outside that transform or module.
compilerIsPrivate (extern)
compile extern:"compiler" fun compilerIsPrivate(handle: int): bool
Whether the declaration a handle names is private to its module.
compilerConformanceCount (extern)
compile extern:"compiler" fun compilerConformanceCount(handle: int): int
Interfaces. A class (a compilerFindClass handle) and the interfaces it conforms to, at the class or by extend, in declaration order.
compilerConformanceName (extern)
compile extern:"compiler" fun compilerConformanceName(
handle: int,
index: int
): string
Returns the indexed interface name in the class's conformances, reporting a compile-time error for an invalid class handle or index.
compilerImplementerCount (extern)
compile extern:"compiler" fun compilerImplementerCount(name: string): int
The classes conforming to the interface name, in declaration order.
compilerImplementerName (extern)
compile extern:"compiler" fun compilerImplementerName(
name: string,
index: int
): string
Returns the indexed class name implementing the given interface, reporting a compile-time error for an out-of-range index.
compilerWitnessCount (extern)
compile extern:"compiler" fun compilerWitnessCount(handle: int, name: string): int
The class's witness for the interface name: per member, member:kind (kind: method, extension, default or missing).
compilerWitnessEntry (extern)
compile extern:"compiler" fun compilerWitnessEntry(
handle: int,
name: string,
index: int
): string
Returns member:kind for the indexed interface member, reporting a compile-time error for an invalid class, interface, or index.
compilerDeclareInterface (extern)
compile extern:"compiler" fun compilerDeclareInterface(
name: string,
members: string,
parents: string
): bool
From a transform: interface name : parents { members }, and extend <class> : name with each member's source as an extension function.
compilerAddConformance (extern)
compile extern:"compiler" fun compilerAddConformance(
handle: int,
name: string,
members: string
): bool
Returns true when the transform stages an interface conformance and its member source, and reports a compile-time error for an invalid request.
compilerFindType (extern)
compile extern:"compiler" fun compilerFindType(name: string): int
Structured, compilation-scoped type reflection. Handles are opaque indexes into an interned canonical type table and never expose semantic pointers.
compilerTypeName (extern)
compile extern:"compiler" fun compilerTypeName(handle: int): string
Returns the source spelling of a reflected type or reports a compile-time error for an invalid type handle.
compilerTypeKind (extern)
compile extern:"compiler" fun compilerTypeKind(handle: int): string
Returns the reflected type's category, such as array or nullable, or reports a compile-time error for an invalid handle.
compilerTypeIsNullable (extern)
compile extern:"compiler" fun compilerTypeIsNullable(handle: int): bool
Returns whether the reflected type permits null, reporting a compile-time error for an invalid type handle.
compilerTypeIsAffine (extern)
compile extern:"compiler" fun compilerTypeIsAffine(handle: int): bool
Returns whether the reflected type is affine, reporting a compile-time error for an invalid type handle.
compilerTypeArgumentCount (extern)
compile extern:"compiler" fun compilerTypeArgumentCount(handle: int): int
Returns the number of reflected type arguments or function parameter types, reporting a compile-time error for an invalid type handle.
compilerTypeArgument (extern)
compile extern:"compiler" fun compilerTypeArgument(
handle: int,
argument: int
): int
Returns the indexed type argument handle, reporting a compile-time error for an invalid handle or index.
compilerTypeElement (extern)
compile extern:"compiler" fun compilerTypeElement(handle: int): int
Returns the wrapped element type handle or reports a compile-time error if the type or its element is unavailable.
compilerTypeResult (extern)
compile extern:"compiler" fun compilerTypeResult(handle: int): int
Returns the result type handle of a function type or reports a compile-time error if the handle or function type is invalid.
compilerTypeDeclaration (extern)
compile extern:"compiler" fun compilerTypeDeclaration(handle: int): int
Returns the nominal class declaration handle, or -1 for non-class types.
compilerFunctionParameterTypeHandle (extern)
compile extern:"compiler" fun compilerFunctionParameterTypeHandle(
handle: int,
parameter: int
): int
Returns the reflected type handle for the indexed function parameter, reporting a compile-time error for an invalid handle or index.
compilerFunctionResultTypeHandle (extern)
compile extern:"compiler" fun compilerFunctionResultTypeHandle(
handle: int
): int
Returns the reflected result type handle for the function, reporting a compile-time error if reflection cannot resolve it.
compilerFunctionGenericSubstitutionCount (extern)
compile extern:"compiler" fun compilerFunctionGenericSubstitutionCount(
handle: int
): int
Reserved generic-substitution surface. It returns zero for today's non-generic declarations and becomes populated without an API break when selected-call generics are introduced.
compilerFunctionGenericSubstitutionName (extern)
compile extern:"compiler" fun compilerFunctionGenericSubstitutionName(
handle: int,
substitution: int
): string
Returns the type parameter name for the indexed substitution, reporting a compile-time error for an invalid function handle or index.
compilerGenericInstanceCount (extern)
compile extern:"compiler" fun compilerGenericInstanceCount(name: string): int
A generic's instances (Box: Box<i64>, …), and an instance asked for by its spelling (Box<int>), made from a transform.
compilerGenericInstanceName (extern)
compile extern:"compiler" fun compilerGenericInstanceName(name: string, index: int): string
Returns the indexed concrete instance name of the given generic, reporting a compile-time error for an out-of-range index.
compilerInstantiate (extern)
compile extern:"compiler" fun compilerInstantiate(spelling: string): string
Returns the reflected generic instance name, reporting a compile-time error when the spelling or argument count is invalid or a new instance cannot be staged.
compilerFunctionGenericSubstitutionTypeHandle (extern)
compile extern:"compiler" fun compilerFunctionGenericSubstitutionTypeHandle(
handle: int,
substitution: int
): int
Returns the substituted type handle for the indexed generic parameter, reporting a compile-time error for an invalid function handle or index.
compilerClassFieldTypeHandle (extern)
compile extern:"compiler" fun compilerClassFieldTypeHandle(
handle: int,
field: int
): int
Returns the reflected type handle of the indexed class field, reporting a compile-time error when no such typed field exists.
compilerGrant (extern)
compile extern:"compiler" fun compilerGrant(capability: string)
Declares a non-hermetic compile-time input in source. The grant is part of the bundled-source fingerprint; builds without it deny ambient effects.
compilerEnvironment (extern)
compile extern:"compiler" fun compilerEnvironment(name: string): string
Reads one explicitly named build environment input. The compiler journals the observed value, so a native-object cache hit is valid only while that variable remains unchanged. Missing variables produce an empty string.
compilerReadDependencyFile (extern)
compile extern:"compiler" fun compilerReadDependencyFile(name: string, relativePath: string): string
Reads one file of a locked dependency's tree (needs filesystem.read, like any compile-time read). name is a dependency in the abla.toml of the package whose # site makes the call (the project's own for its code); the file is a regular file of the tree abla.lock pins by digest, named by a slash-separated package-relative path (no absolute, empty, ., .., .git or .abla* component, no backslash). Symbolic links, on the way or at the leaf, are refused. The bytes come from the locked tree, from a checked-in vendor/<name> or the prepared copy alike; the call never fetches or installs, and a dependency, pin or file that is not there is a compile-time error naming the package and path. The build journals the pin and the bytes: a cached build is reused only while they are the same.
compilerWriteFile (extern)
compile extern:"compiler" fun compilerWriteFile(
path: string,
contents: string
): bool
Writes one project-relative file, at once (a real write, as abla/fs writes are under #): it is on disk when the call returns, and stays there if the build fails later. Absolute paths, ./.. components, payloads above 16 MiB and more than 256 MiB in one build are rejected. The file is written beside its target and renamed over it.
compilerClockMilliseconds (extern)
compile extern:"compiler" fun compilerClockMilliseconds(): int
Explicitly ambient providers. Unlike named environment inputs, their grants intentionally make native-object publication non-cacheable.
compilerRandomInteger (extern)
compile extern:"compiler" fun compilerRandomInteger(maxExclusive: int): int
Returns a random integer in [0, maxExclusive), reporting a compile-time error if the bound is nonpositive or random access is not granted.
compilerRunProcess (extern)
compile extern:"compiler" fun compilerRunProcess(
arguments: array<string>
): int
Returns the child process status, reporting a compile-time error if process access is not granted or the argument vector is invalid.
CompilerProcessResult (class)
class CompilerProcessResult(
val exitCode: int,
val stdout: string,
val failure: string,
val bytesRead: int
)
Captures at most 1 MiB with a deadline of at most ten seconds. Uses the build environment unchanged, closed stdin and inherited stderr. No shell is added. failure is empty for normal exits (including nonzero exits); otherwise it is launch, timeout, output-limit, signal, read or wait. Failed captures return no stdout. bytesRead counts observed stdout bytes, at most maxStdoutBytes + 1; output-limit means at least that many bytes, not the child's total output.
compilerCaptureProcess (extern)
compile extern:"compiler" fun compilerCaptureProcess(
arguments: array<string>,
maxStdoutBytes: int = 1048576,
timeoutMilliseconds: int = 10000
): CompilerProcessResult
Returns bounded stdout and process status or failure details, reporting a compile-time error for invalid arguments or missing process access.
compilerTcpExchange (extern)
compile extern:"compiler" fun compilerTcpExchange(
ipv4Address: string,
port: int,
request: string,
maxResponseBytes: int,
timeoutMilliseconds: int
): string
Performs one numeric-IPv4 TCP request/response exchange. Payload/response are capped at 1 MiB and the connect/read timeout at ten seconds. Network capability always disables native-object caching.
compilerGenerateModule (extern)
compile extern:"compiler" fun compilerGenerateModule(
namespace: string,
source: string
)
Submits one deterministic virtual module. It is parsed and checked with the complete candidate program; no declarations are published after a failure.
compilerBuildProgram (extern)
compile extern:"compiler" fun compilerBuildProgram(
name: string,
entry: string,
output: string,
target: string,
artifact: string,
fast: bool,
cache: bool
): bool
Adds one program node to the current programmable build transaction. Paths are project-relative. The compiler evaluates the complete build definition first, validates the resulting graph, and only then compiles its nodes. Artifact kinds and target names are interpreted by the selected toolchain, not by platform-specific logic in the language frontend.
compilerContributeArtifactRoot (extern)
compile extern:"compiler" fun compilerContributeArtifactRoot(
name: string,
target: string,
artifact: string,
output: string,
function: int,
exportName: string,
fast: bool,
cache: bool
): bool
Adds one exact resolved function root to a named child artifact. Repeated contributions with the same artifact configuration are aggregated into one target compilation and exported under their explicit foreign names.
compilerDefineTarget (extern)
compile extern:"compiler" fun compilerDefineTarget(
name: string,
llvmTriple: string,
objectFormat: string,
linkerFlavor: string,
linkerEmulation: string,
hosted: bool,
libcFree: bool
): bool
Registers one bounded target description for program nodes in the current build graph. Platform packages own these values; the compiler interprets only generic LLVM/object/linker properties.
compilerDefineTargetSdk (extern)
compile extern:"compiler" fun compilerDefineTargetSdk(
name: string,
sdk: string
): bool
Selects an Apple SDK for an already registered target.
compilerDefineTargetLinkInput (extern)
compile extern:"compiler" fun compilerDefineTargetLinkInput(
name: string,
path: string,
asNeeded: bool = false
): bool
Adds an input to the shared-library link of an already registered ELF target (an absolute, one-line path; at most 16 per target; they follow the object in the order given). The target's build extension finds them at build time, for example a platform's runtime archive. When asNeeded is true, the linker records a shared library only if used.
compilerCreateXcframework (extern)
compile extern:"compiler" fun compilerCreateXcframework(
output: string,
slices: array<string>,
headersDirectory: string
): bool
Stages packaging after all program nodes succeed. The bool means accepted.
compilerExportFunction (extern)
compile extern:"compiler" fun compilerExportFunction(
function: int,
name: string
): bool
Publishes a stable foreign symbol for a resolved top-level function. The The ABI rung accepts bounded scalar, copied borrowed-string, and direct non-escaping callback parameters and returns void, scalars, or an owned byte handle for string. No internal Abla value layout crosses the boundary.
compilerInternalFunction (extern)
compile extern:"compiler" fun compilerInternalFunction(
function: int,
name: string
): bool
Emits the same stable foreign ABI adapter with LLVM internal linkage. It is retained for assembly references but is not a public object-file boundary.
compilerRequiredInternalFunction (extern)
compile extern:"compiler" fun compilerRequiredInternalFunction(
function: int,
name: string
): bool
Provides an internally linked implementation for an exact symbol that may be introduced only during target lowering, after Abla reachability has been computed. Unlike an ordinary internalFunction edge, this request itself is sufficient to retain the implementation.
compilerExportCheckedFunction (extern)
compile extern:"compiler" fun compilerExportCheckedFunction(
function: int,
name: string
): bool
Publishes a status-returning adapter that contains Abla panics on targets advertising the checked-export runtime capability.
compilerReplaceFunctionBody (extern)
compile extern:"compiler" fun compilerReplaceFunctionBody(
function: int,
body: string
): bool
Validated source mutation is collected only while a top-level #compiler.transform(...) action is running. The candidate program is parsed and analyzed again before any artifact can be published.
compilerAddFunctionAnnotation (extern)
compile extern:"compiler" fun compilerAddFunctionAnnotation(
function: int,
annotation: string
): bool
Returns true when a transform stages a new annotation on the function, reporting a compile-time error for invalid or duplicate annotations or requests outside a transform.
DeclarationBlock (class)
compile class DeclarationBlock
Independent program construction. DeclarationBlock is an opaque syntax value produced by a trailing { fun ... } declaration block; it cannot be constructed or consumed as a runtime value.
compilerNewIndependentModule (extern)
compile extern:"compiler" fun compilerNewIndependentModule(name: string): int
Returns a handle for a new independent module, reporting a compile-time error for an invalid or duplicate module name.
compilerIndependentModuleUse (extern)
compile extern:"compiler" fun compilerIndependentModuleUse(
module: int,
function: int,
annotations: array<string>,
exportName: string,
checkedExport: bool
): bool
Returns true if a live independent module accepts the function and metadata, reporting a compile-time error for invalid handles, annotations, or exports.
compilerIndependentModuleExport (extern)
compile extern:"compiler" fun compilerIndependentModuleExport(
module: int,
sourceName: string,
exportName: string,
checked: bool
): bool
Returns true if a live independent module accepts the foreign export, reporting a compile-time error for an invalid or duplicate export.
compilerIndependentModuleDeclare (extern)
compile extern:"compiler" fun compilerIndependentModuleDeclare(
module: int,
declarations: DeclarationBlock
): bool
Returns true if the live independent module accepts the compile-time declaration block, reporting a compile-time error for an invalid module or block.
compilerIndependentModuleEmit (extern)
compile extern:"compiler" fun compilerIndependentModuleEmit(
module: int,
output: string,
target: string,
artifact: string,
fast: bool,
cache: bool
): bool
Returns true if the compiler stages emission of a live module with the given output and target settings, reporting a compile-time error for an invalid request.
compilerApplyTransform (extern)
compile extern:"compiler" fun compilerApplyTransform(
action: () -> void
): bool
Internal staging marker consumed by the frontend. Public code uses the method-shaped compiler.transform(...) surface below.
Compiler (class)
class Compiler
Public compile-time service. Importing abla/compiler makes this single object available; the standalone externs above are the version-0 bootstrap ABI and are not the preferred user surface.
FunctionReference (class)
compile class FunctionReference(
val handle: int,
val annotations: array<string>,
val exportName: string,
val checkedExport: bool
)
A compile-time function handle with annotations and foreign export metadata for an independent module.
IndependentModule (class)
compile class IndependentModule(val handle: int)
A compile-time handle for an independent module that accepts declarations before emission.
compiler (compile.val)
compile val compiler: Compiler
The compile-time service for reflecting on declarations, transforming a program, and scheduling builds.
Compiler.transform (extension compile.fun)
compile fun Compiler.transform(action: () -> void): bool
Runs action as a compile-time transform. Returns whether the compiler accepted the resulting program.
Compiler.findClass (extension compile.fun)
compile fun Compiler.findClass(name: string): int
The class named name's handle, -1 when there is none. A private class is found from its own module only.
Compiler.findType (extension compile.fun)
compile fun Compiler.findType(name: string): int
The type handle of the type spelled name (int, array<string>, Square). In a generic's # code, a type parameter T is its type argument's handle.
Compiler.typeName (extension compile.fun)
compile fun Compiler.typeName(type: int): string
The type handle type's spelling (Box<int>).
Compiler.classOf (extension compile.fun)
compile fun Compiler.classOf(type: int): int
The class of the type handle type (a findClass handle), -1 when it is no class.
Compiler.isResource (extension compile.fun)
compile fun Compiler.isResource(type: int): bool
Whether the type handle type is a resource (an instance of a generic class holding one is).
Compiler.typeConformsTo (extension compile.fun)
compile fun Compiler.typeConformsTo(type: int, interfaceName: string): bool
Whether the type handle type is a class conforming to interfaceName (as conformsTo answers for its class), or is that interface. In a generic's body, if (#compiler.typeConformsTo(T, "Hashable")) … else … keeps only the branch each instance takes.
Compiler.typeArguments (extension compile.fun)
compile fun Compiler.typeArguments(type: int): array<int>
The type arguments of the type handle type, as type handles: an instance of a generic class's (Box<int>: int), an array's or a nullable's element; [] for any other type.
Compiler.functionTypeArguments (extension compile.fun)
compile fun Compiler.functionTypeArguments(function: int): array<int>
The type arguments of the function handle function when it is an instance of a generic function (or a method of a generic class's instance), as type handles; [] for any other function.
Compiler.instantiations (extension compile.fun)
compile fun Compiler.instantiations(generic: string): array<string>
The instances of the generic class or function generic the program has, as written (Box<i64>): findType, findClass and findFunction take them.
Compiler.instantiate (extension compile.fun)
compile fun Compiler.instantiate(generic: string, typeArguments: array<string>): string
The instance of the generic class or function generic for typeArguments (instantiate("Box", ["int"])), as written (Box<i64>). From a transform it is made with the program's other instances, as if the program used it; elsewhere it must exist already.
Compiler.isPrivate (extension compile.fun)
compile fun Compiler.isPrivate(handle: int): bool
Whether the declaration (a class or function handle) is private to its module.
Compiler.extensionFields (extension compile.fun)
compile fun Compiler.extensionFields(type: int): array<string>
The extension fields of the class type (a findClass handle).
Compiler.fieldsOf (extension compile.fun)
compile fun Compiler.fieldsOf(type: int, includeExtensions: bool = true): array<string>
The class's fields: its declared ones, then (unless left out) its extension fields.
Compiler.fieldIsDelegated (extension compile.fun)
compile fun Compiler.fieldIsDelegated(type: int, name: string): bool
Whether the class type's declared field name is a delegated property (var balance: int by Box(0)).
Compiler.fieldDelegateType (extension compile.fun)
compile fun Compiler.fieldDelegateType(type: int, name: string): string
The delegate's type of the class type's delegated property name, "" for an ordinary field.
Compiler.addExtensionField (extension compile.fun)
compile fun Compiler.addExtensionField(
type: int,
name: string,
fieldType: string,
initial: string,
mutable: bool = true
): bool
From a transform: var Type.name: fieldType = initial (val when not mutable), as if the program declared it.
Compiler.removeExtensionField (extension compile.fun)
compile fun Compiler.removeExtensionField(type: int, name: string): bool
From a transform: removes an extension field the transform's own module declares.
Compiler.conformances (extension compile.fun)
compile fun Compiler.conformances(type: int): array<string>
The interfaces the class type (a findClass handle) conforms to: those it declares, then those extend adds.
Compiler.conformsTo (extension compile.fun)
compile fun Compiler.conformsTo(type: int, interfaceName: string): bool
Whether the class type conforms to the interface interfaceName (a generic interface's instance as written: Source<int>).
Compiler.implementers (extension compile.fun)
compile fun Compiler.implementers(interfaceName: string): array<string>
The classes that conform to the interface interfaceName.
Compiler.witness (extension compile.fun)
compile fun Compiler.witness(type: int, interfaceName: string): array<string>
What answers each member of interfaceName for the class type, as member:kind: method (the class's own), extension (an extension function), default (the interface's body) or missing.
Compiler.declareInterface (extension compile.fun)
compile fun Compiler.declareInterface(
name: string,
members: array<string>,
parents: array<string> = []
): bool
From a transform: interface name { members } (each member's source, as fun area(): f64 or with a default body), as if the program declared it.
Compiler.addConformance (extension compile.fun)
compile fun Compiler.addConformance(
type: int,
interfaceName: string,
members: array<string> = []
): bool
From a transform: the programmatic extend Type : interfaceName. Each of members is a method's source (fun print(): string = …, this the instance), added as an extension function of the class.
Compiler.functions (extension compile.fun)
compile fun Compiler.functions(): array<int>
Returns the available function handles as a fresh array. Use them within this compilation.
Compiler.bindings (extension compile.fun)
compile fun Compiler.bindings(): array<int>
Returns the available binding handles as a fresh array. Use them within this compilation.
Compiler.findBinding (extension compile.fun)
compile fun Compiler.findBinding(name: string): int
Returns the handle of the last top-level binding named name, or -1 if none exists.
Compiler.bindingName (extension compile.fun)
compile fun Compiler.bindingName(binding: int): string
Returns the name of a top-level binding, reporting a compile-time error for an invalid handle.
Compiler.bindingIsDelegated (extension compile.fun)
compile fun Compiler.bindingIsDelegated(binding: int): bool
Returns whether the binding uses by, reporting a compile-time error for an invalid handle.
Compiler.bindingExposedType (extension compile.fun)
compile fun Compiler.bindingExposedType(binding: int): string
Returns the source-visible type of the binding's value, reporting a compile-time error for an invalid handle.
Compiler.bindingDelegateType (extension compile.fun)
compile fun Compiler.bindingDelegateType(binding: int): string
Returns the source-visible type of the delegate, or an empty string for an ordinary binding, and rejects invalid handles.
Compiler.bindingIsMutable (extension compile.fun)
compile fun Compiler.bindingIsMutable(binding: int): bool
Returns whether the binding was declared with var, reporting a compile-time error for an invalid handle.
Compiler.bindingGetter (extension compile.fun)
compile fun Compiler.bindingGetter(binding: int): int
Returns the delegate's getValue handle or -1 when unavailable, and rejects invalid binding handles.
Compiler.bindingSetter (extension compile.fun)
compile fun Compiler.bindingSetter(binding: int): int
Returns the delegate's setValue handle or -1 when unavailable, and rejects invalid binding handles.
Compiler.bindingCanReplaceDelegate (extension compile.fun)
compile fun Compiler.bindingCanReplaceDelegate(binding: int): bool
Returns whether the binding is both delegated and mutable, reporting a compile-time error for an invalid handle.
Compiler.bindingByBegin (extension compile.fun)
compile fun Compiler.bindingByBegin(binding: int): int
Returns the first source byte offset of the by expression, or -1 for an ordinary binding, and rejects invalid handles.
Compiler.bindingByEnd (extension compile.fun)
compile fun Compiler.bindingByEnd(binding: int): int
Returns the exclusive end byte offset of the by expression, or -1 for an ordinary binding, and rejects invalid handles.
Compiler.functionsAnnotated (extension compile.fun)
compile fun Compiler.functionsAnnotated(annotation: string): array<int>
Returns a fresh array of top-level function handles with the exact annotation, or an empty array if none match.
Compiler.findFunction (extension compile.fun)
compile fun Compiler.findFunction(name: string): int
Finds the function or method named by name in this compilation. Returns -1 when absent.
Compiler.function (extension compile.fun)
compile fun Compiler.function(name: string): FunctionReference
A typed wrapper around a compilation-scoped function handle. Additional annotations are immutable metadata applied only to a destination module when this reference is used there.
Compiler.reference (extension compile.fun)
compile fun Compiler.reference(handle: int): FunctionReference
Wraps an already reflected function without resolving it again by name. This is the preferred bridge from functionsAnnotated() and typed call inspection into an independent module.
FunctionReference.annotated (extension compile.fun)
compile fun FunctionReference.annotated(
annotation: string
): FunctionReference
Returns a new reference with annotation appended for validation when the destination module uses it.
FunctionReference.exported (extension compile.fun)
compile fun FunctionReference.exported(name: string): FunctionReference
Marks the destination copy as a foreign artifact root. The source function keeps its Abla name; only the standalone module receives this export name.
FunctionReference.checkedExported (extension compile.fun)
compile fun FunctionReference.checkedExported(
name: string
): FunctionReference
Returns a new reference requesting a checked foreign export, with the name validated when the destination module uses it.
Compiler.newModule (extension compile.fun)
compile fun Compiler.newModule(name: string): IndependentModule
Creates an independent module named name for compile-time declaration selection and artifact emission.
IndependentModule.use (extension compile.fun)
compile fun IndependentModule.use(function: FunctionReference): bool
Adds the declaration and metadata in function to this independent module. Returns whether the compiler accepted it.
IndependentModule.export (extension compile.fun)
compile fun IndependentModule.export(
sourceName: string,
name: string,
checked: bool = false
): bool
Exports a declaration added by declare(), including a name returned by a compiler-owned generated-declaration builder. Existing declarations should normally use FunctionReference.exported() so their handle remains typed.
IndependentModule.declare (extension compile.fun)
compile fun IndependentModule.declare(
declarations: DeclarationBlock
): bool
Adds the compile-time declarations block to the independent module. Returns whether the compiler accepted it.
IndependentModule.emit (extension compile.fun)
compile fun IndependentModule.emit(
output: string,
target: string = "host",
artifact: string = "executable",
fast: bool = false,
cache: bool = true
): bool
Emits the independent module at output for target and artifact. Use fast to select fast compilation and cache to permit caching. Returns whether emission succeeded.
Compiler.functionName (extension compile.fun)
compile fun Compiler.functionName(function: int): string
Returns the source name of the function named by handle function. An invalid handle produces a compile-time error.
Compiler.functionIdentity (extension compile.fun)
compile fun Compiler.functionIdentity(function: int): string
Returns the compiler's canonical identity for handle function, including its owner when applicable. An invalid handle produces a compile-time error.
Compiler.functionModuleIdentity (extension compile.fun)
compile fun Compiler.functionModuleIdentity(function: int): string
Returns the canonical module identity for handle function. An invalid handle produces a compile-time error.
Compiler.functionOwner (extension compile.fun)
compile fun Compiler.functionOwner(function: int): string
Returns the method's receiver type, or an empty string for a top-level function, and rejects invalid handles.
Compiler.parameterCount (extension compile.fun)
compile fun Compiler.parameterCount(function: int): int
Returns the number of declared parameters of handle function. An invalid handle produces a compile-time error.
Compiler.parameterName (extension compile.fun)
compile fun Compiler.parameterName(function: int, parameter: int): string
Returns the name of zero-based parameter of handle function. Invalid indices or handles produce a compile-time error.
Compiler.parameterType (extension compile.fun)
compile fun Compiler.parameterType(function: int, parameter: int): string
Returns the normalized source-visible type of zero-based parameter of handle function. Invalid indices or handles produce a compile-time error.
Compiler.resultType (extension compile.fun)
compile fun Compiler.resultType(function: int): string
Returns the reflected result type of handle function. An invalid handle produces a compile-time error.
Compiler.annotationCount (extension compile.fun)
compile fun Compiler.annotationCount(function: int): int
Returns the number of annotations attached to the function or reports a compile-time error for an invalid handle.
Compiler.annotation (extension compile.fun)
compile fun Compiler.annotation(function: int, annotation: int): string
Returns the annotation name at zero-based annotation on handle function. An invalid handle or index produces a compile-time error.
Compiler.annotationArgumentCount (extension compile.fun)
compile fun Compiler.annotationArgumentCount(
function: int,
annotation: int
): int
Returns one if the annotation has an argument or zero otherwise, reporting a compile-time error for an invalid function handle or annotation index.
Compiler.annotationArgumentKind (extension compile.fun)
compile fun Compiler.annotationArgumentKind(
function: int,
annotation: int,
argument: int = 0
): string
Returns the syntax kind of annotation argument zero, reporting a compile-time error for an invalid handle, annotation, or argument.
Compiler.annotationArgumentText (extension compile.fun)
compile fun Compiler.annotationArgumentText(
function: int,
annotation: int,
argument: int = 0
): string
Returns the syntax text of annotation argument zero, reporting a compile-time error for an invalid handle, annotation, or argument.
Compiler.isCompileOnly (extension compile.fun)
compile fun Compiler.isCompileOnly(function: int): bool
Returns whether the handle names a compile fun, reporting a compile-time error for an invalid handle.
Compiler.isTrusted (extension compile.fun)
compile fun Compiler.isTrusted(function: int): bool
Returns whether the function is declared trusted, reporting a compile-time error for an invalid handle.
Compiler.isExternal (extension compile.fun)
compile fun Compiler.isExternal(function: int): bool
Returns whether the function is declared extern, reporting a compile-time error for an invalid handle.
Compiler.replaceFunctionBody (extension compile.fun)
compile fun Compiler.replaceFunctionBody(
function: int,
body: string
): bool
Returns true if the enclosing transform stages body as new source for function, and rejects invalid targets or requests outside a transform.
Compiler.addFunctionAnnotation (extension compile.fun)
compile fun Compiler.addFunctionAnnotation(
function: int,
annotation: string
): bool
Returns true when a transform stages a new annotation on the function, reporting a compile-time error for invalid or duplicate annotations or requests outside a transform.
Compiler.generateModule (extension compile.fun)
compile fun Compiler.generateModule(namespace: string, source: string)
Submits source as a virtual module under namespace, reporting a compile-time error if the compiler rejects the generated module.
Compiler.writeFile (extension compile.fun)
compile fun Compiler.writeFile(path: string, contents: string): bool
Writes contents to project-relative path during compilation. Returns whether the write succeeded and requires the compiler's filesystem-write grant.
Compiler.buildProgram (extension compile.fun)
compile fun Compiler.buildProgram(
name: string,
entry: string,
output: string,
target: string,
artifact: string,
fast: bool,
cache: bool
): bool
Adds a program node named name from entry to the build graph. Set output, target, artifact, fast compilation, and cache policy. Returns whether the node was accepted. The graph is built after evaluation.
Compiler.defineTarget (extension compile.fun)
compile fun Compiler.defineTarget(
name: string,
llvmTriple: string,
objectFormat: string,
linkerFlavor: string,
linkerEmulation: string,
hosted: bool,
libcFree: bool
): bool
Returns true when the current build graph accepts the named target description, or false when the compiler rejects it.
Compiler.defineTargetSdk (extension compile.fun)
compile fun Compiler.defineTargetSdk(name: string, sdk: string): bool
Returns true when the current build graph accepts the SDK for the named target, or false when the compiler rejects it.
Compiler.defineTargetLinkInput (extension compile.fun)
compile fun Compiler.defineTargetLinkInput(name: string, path: string, asNeeded: bool = false): bool
Returns true if the build graph accepts the ELF link input. With asNeeded, a shared library is retained only if used.
Compiler.createXcframework (extension compile.fun)
compile fun Compiler.createXcframework(
output: string,
slices: array<string>,
headersDirectory: string
): bool
Returns true when the build graph accepts an XCFramework request with the given slices and headers, or false when the compiler rejects it.
Compiler.contributeArtifactRoot (extension compile.fun)
compile fun Compiler.contributeArtifactRoot(
name: string,
target: string,
artifact: string,
output: string,
function: int,
exportName: string,
fast: bool,
cache: bool
): bool
Returns true if the compiler adds the function and export name to the child artifact, or false for an invalid contribution.
Compiler.exportFunction (extension compile.fun)
compile fun Compiler.exportFunction(function: int, name: string): bool
Exports the declaration identified by function under foreign symbol name. Returns whether the compiler accepted it.
Compiler.internalFunction (extension compile.fun)
compile fun Compiler.internalFunction(function: int, name: string): bool
Returns true if the compiler marks the function as an internal artifact symbol under name, or false for an invalid request.
Compiler.requiredInternalFunction (extension compile.fun)
compile fun Compiler.requiredInternalFunction(
function: int,
name: string
): bool
Keeps the declaration named by handle function under object symbol name for backend references. Returns whether the compiler accepted it.
Compiler.exportCheckedFunction (extension compile.fun)
compile fun Compiler.exportCheckedFunction(
function: int,
name: string
): bool
Returns true if the compiler accepts the function and name for a checked foreign export, or false for an invalid request.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.