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

KernelEvaluate expression to be executed in evaluated rather than in compiled code

KernelFunction function to be executed in evaluated rather than in compiled code

IfCompiled specify different code for evaluated and compiled processing

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

TypeHint specify a type inside the body of a function

ForAllType a type that takes parameters

TypeEvaluate a type generated by evaluation

LiteralType a literal value used as a type

SequenceType a type that represents variable argument functions

TypeOf the type of an expression

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

Compiler Declarations

FunctionDeclaration an auxiliary function declaration to use in compilation

LibraryFunctionDeclaration an auxiliary declaration of a library function to use in compilation

TypeDeclaration an auxiliary type declaration to use in compilation

CompiledExpressionDeclaration an auxiliary declaration of a type with expression embedding to use in compilation

DownValuesFunction use definitions attached to a symbol when compiling code

Compilation Environment

CreateCompilerEnvironment create a new environment of compilation definitions

$CompilerEnvironment the default compiler environment

CompilerEnvironmentAppendTo add an auxiliary declaration to a compiler environment

CompilerEnvironmentObject an environment of compilation definitions

Compilation Options

CompilerEnvironment an environment of compiler declarations to use in compilation

CompilerOptions detailed options to be passed into the compilation pipeline

TargetSystem machine architectures to be targeted by compilation

Compiled Components

CompiledComponent a named group of compiler declarations

DeclareCompiledComponent add declarations to a compiled component

BuildCompiledComponent build a shared library for a compiled component

LoadCompiledComponent load and install a shared library from a built component

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