This page covers the Haxe extern/runtime surface that maps to core Elixir/Erlang APIs.
elixir.Kernelelixir.Atomelixir.Enumelixir.Listelixir.Tupleelixir.ElixirMapelixir.ElixirStringelixir.ElixirEnum
Why use these surfaces:
- Keep generated output idiomatic and deterministic
- Preserve typing for common BEAM primitives in Haxe code
- Avoid stringly/dynamic interop at callsites
elixir.Processelixir.GenServerelixir.Taskelixir.TaskSupervisorelixir.Applicationelixir.otp.Supervisorelixir.otp.TypeSafeChildSpec
Use these for typed OTP process and supervision-tree composition in Haxe while emitting standard Elixir runtime patterns.
TypeSafeChildSpec guidance:
- Prefer typed module refs (
TypeSafeChildSpec.endpoint(EndpointExtern)) so unresolved modules fail at compile time. - For pure Elixir modules, add a small
@:native("...") extern class ... {}wrapper and keep callsites typed (add@:unsafeExternwhere strict mode requires explicit app-local boundaries). - Use
*Unsafevariants only for intentional dynamic/legacy strings. - Canonical API reference:
docs/04-api-reference/TYPE_SAFE_CHILD_SPEC.md.
elixir.IO,elixir.File,elixir.Path,elixir.System,elixir.Regex,elixir.Stream,elixir.DateTimeelixir.Module,elixir.Code,elixir.Node,elixir.Registryelixir.HttpClient,elixir.Jason
Typed wrappers are provided for BEAM values and runtime contracts:
- core values:
Term,Atom,Pid,Reference - process/runtime info:
ProcessInfo,ProcessFlag,MessageQueueData,ExitReason - GenServer contracts:
GenServerRef,GenServerOption,GenServerCallbackResults - task/registry:
TaskRef,TaskResult,RegistryKey,RegistryOptions
Why wrappers matter:
- improve compile-time safety at boundary-heavy code
- reduce accidental
Dynamicspread in business logic - clarify runtime semantics in signatures
Most runtime interop modules use metadata such as:
@:nativeto pin exact target module/function names@:overloadto expose ergonomic type-safe signatures over one emitted runtime implementation@:from/@:tofor typed conversion abstractions
- Prefer typed wrappers (
Term, typed result enums, typed callback result unions) over raw dynamic maps - Keep OTP callback signatures explicit and consistent with target callback contracts
- Use child-spec helpers for supervision tree composition instead of ad-hoc tuple/string assembly
- Missing
@:nativeon callback/function names that must map to exact Elixir callback names - Treating wrappers as runtime allocations rather than compile-time type surfaces
- Overusing raw
Termin code that can be strongly typed via provided wrappers
docs/04-api-reference/ANNOTATIONS.mddocs/04-api-reference/HAXE_MACRO_APIS.mddocs/04-api-reference/STDLIB_SUPPORT_MATRIX.mddocs/04-api-reference/TYPE_SAFE_CHILD_SPEC.md