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 Definitions

FunctionDeclaration an auxiliary function declaration to use in compilation

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

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