Julia uses three calling conventions for four distinct purposes:
| Name | Prefix | Purpose |
|---|---|---|
| Native | julia_ | Speed via specialized signatures |
| JL Call | jlcall_ | Wrapper for generic calls |
| JL Call | jl_ | Builtins |
| C ABI | jlcapi_ | Wrapper callable from C |
The native calling convention is designed for fast non-generic calls. It usually uses a specialized signature.
A small return values is returned as LLVM return values. A large return values is returned via the "structure return" (sret) convention, where the caller provides a pointer to a return slot.
An argument or return values that is a homogeneous tuple is sometimes represented as an LLVM vector instead of an LLVM array.
The JL Call convention is for builtins and generic dispatch. Hand-written functions using this convention are declared via the macroJL_CALLABLE. The convention uses exactly 3 parameters:
F - Julia representation of function that is being appliedargs - pointer to array of pointers to boxesnargs - length of the arrayThe return value is a pointer to a box.
C ABI wrappers enable calling Julia from C. The wrapper calls a function using the native calling convention.
Tuples are always represented as C arrays.
Settings
This document was generated withDocumenter.jl version 1.16.0 onThursday 20 November 2025. Using Julia version 1.12.2.