({{, (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction])[…] 
is a function created by (RefLink[FunctionCompile, paclet:ref/FunctionCompile]) that contains compiled code that is run when the (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]) is applied to suitable arguments. }})

OpenersNotesSection(Spacer1)Details

(RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]) objects typically accept only arguments that conform to specified types.

If nonconforming arguments are provided, (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]) returns a (RefLink[Failure, paclet:ref/Failure]) object.

(RefLink[FunctionCompileExport, paclet:ref/FunctionCompileExport]) and related functions can be used to generate code suitable for external use from (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction])[…].

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

(RefLink[FunctionCompile, paclet:ref/FunctionCompile]) creates a (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]):

cf=FunctionCompile[Function[Typed[arg,"MachineInteger"],arg+1]]

The (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]) evaluates with an argument of the correct type:

cf[20]

(RefLink[Information, paclet:ref/Information]) returns information about a (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]):

Information[cf]

Extract just the type signature for the function:

Information[cf,"Signature"]

OpenersExampleSection2(Spacer1)Possible Issues  (1)

A (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]) contains information about how it was created:

cf=FunctionCompile[Function[Typed[arg,"Integer64"],arg+1]];cf//InputForm

If a (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]) is written to a file and loaded, a new functioning (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]) is created:

cf>>comp.wl;
cf1=<<comp.wl

The restored (RefLink[CompiledCodeFunction, paclet:ref/CompiledCodeFunction]) works as expected:

cf1[10]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[FunctionCompile, paclet:ref/FunctionCompile])  ▪  (RefLink[FunctionCompileExport, paclet:ref/FunctionCompileExport])  ▪  (RefLink[FunctionCompileExportLibrary, paclet:ref/FunctionCompileExportLibrary])  ▪  (RefLink[FunctionCompileExportString, paclet:ref/FunctionCompileExportString])  ▪  (RefLink[FunctionCompileExportByteArray, paclet:ref/FunctionCompileExportByteArray])  ▪  (RefLink[CompiledFunction, paclet:ref/CompiledFunction])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Code Compilation, paclet:guide/CodeCompilation])}})}})