CompiledCodeFunction
✖
CompiledCodeFunction
is a function created by FunctionCompile that contains compiled code that is run when the CompiledCodeFunction is applied to suitable arguments.
Details

- CompiledCodeFunction objects typically accept only arguments that conform to specified types.
- If nonconforming arguments are provided, CompiledCodeFunction returns a Failure object.
- FunctionCompileExport and related functions can be used to generate code suitable for external use from CompiledCodeFunction[…].
- CompiledCodeFunction objects can include embedded libraries or byte code to optimize loading.
- Information for a CompiledCodeFunction may include the following properties:
-
"ArgumentTypes" types of arguments "LLVMBinary" LLVM binary code "ReturnType" return type "Type" full type
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
FunctionCompile creates a CompiledCodeFunction:

https://wolfram.com/xid/0dcz74gu94q6-ck3oom

The CompiledCodeFunction evaluates with an argument of the correct type:

https://wolfram.com/xid/0dcz74gu94q6-lj8jw2

Information returns information about a CompiledCodeFunction:

https://wolfram.com/xid/0dcz74gu94q6-l7nozw

Extract just the type signature for the function:

https://wolfram.com/xid/0dcz74gu94q6-jlt7q9

Scope (3)Survey of the scope of standard use cases
A CompiledCodeFunction contains information about how it was created, which can enable loading from a file. By default, platform-dependent byte code is included:

https://wolfram.com/xid/0dcz74gu94q6-g19dow

If a CompiledCodeFunction is written to a file and loaded, a new functioning CompiledCodeFunction is created. If byte code is found that matches the current platform, that will be used:

https://wolfram.com/xid/0dcz74gu94q6-hba7hm

The restored CompiledCodeFunction works as expected:

https://wolfram.com/xid/0dcz74gu94q6-16wb2q

Platform-dependent byte code can be created for a range of platforms. This can be used if the CompiledCodeFunction was loaded into a different system:

https://wolfram.com/xid/0dcz74gu94q6-kav1qn

A shared library can be embedded in the output:

https://wolfram.com/xid/0dcz74gu94q6-80txia

The library will be used when the code function is loaded from a file. This makes loading faster:

https://wolfram.com/xid/0dcz74gu94q6-4mm7to

The restored CompiledCodeFunction works as expected:

https://wolfram.com/xid/0dcz74gu94q6-uvkfas

Wolfram Research (2019), CompiledCodeFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/CompiledCodeFunction.html.
Text
Wolfram Research (2019), CompiledCodeFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/CompiledCodeFunction.html.
Wolfram Research (2019), CompiledCodeFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/CompiledCodeFunction.html.
CMS
Wolfram Language. 2019. "CompiledCodeFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CompiledCodeFunction.html.
Wolfram Language. 2019. "CompiledCodeFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CompiledCodeFunction.html.
APA
Wolfram Language. (2019). CompiledCodeFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CompiledCodeFunction.html
Wolfram Language. (2019). CompiledCodeFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CompiledCodeFunction.html
BibTeX
@misc{reference.wolfram_2025_compiledcodefunction, author="Wolfram Research", title="{CompiledCodeFunction}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/CompiledCodeFunction.html}", note=[Accessed: 11-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_compiledcodefunction, organization={Wolfram Research}, title={CompiledCodeFunction}, year={2019}, url={https://reference.wolfram.com/language/ref/CompiledCodeFunction.html}, note=[Accessed: 11-May-2025
]}