Code Compilation

The Wolfram Language has advanced compilation capabilities that allow an increasingly wide range of Wolfram Language code to be compiled into native machine code. Advanced type inferencing allows types to be inferred automatically or specified in minimal ways by users. The Wolfram Compiler produces LLVM code and can generate executable code suitable not only for internal use by the Wolfram System, but also for linking into external programs.

Creating Compiled Code

FunctionCompile create a compiled version of a pure function

CompiledCodeFunction representation of a function implemented with compiled code

Code Annotation

KernelFunction function to be executed in the kernel rather than in compiled code

Annotation specify arbitrary hints and annotations for code

Type Specification »

Typed define what type an object is to be taken to have

"Boolean"  ▪  "UnsignedInteger32"  ▪  "UnsignedInteger64"  ▪  "Integer32"  ▪  "Integer64"  ▪  "MachineInteger"  ▪  "Real64"  ▪  "ComplexReal64"  ▪  ...

TypeSpecifier elements used to construct type specifications

"NumericArray"  ▪  "PackedArray"

{type1,type2,}type type signature for a function

Handling Compiled Code

Information get information about a compiled code function

Exporting Compiled Code

FunctionCompileExport create an object file by compiling a pure function

FunctionCompileExportLibrary create a shared library by compiling a pure function

FunctionCompileExportString give a string of compiled code for a given pure function

FunctionCompileExportByteArray give a binary form of compiled code

EmbedCode create an embeddable version of an external code library

Compilation Options

TargetSystem the $SystemID of the target architecture for external code

CompilerOptions detailed options to be passed into the compilation pipeline

Lightweight Numerical Compiler

Compile compile code for basic numerical evaluation

CompiledFunction function created by Compile

Compiled option for functions such as FindRoot to specify whether to automatically compile