"Julia" (External Evaluation System)

Details

  • Julia Version 0.7 and higher is supported. For ExternalFunction support, Julia 1.2 or higher is required.
  • Julia is a high-level, high-performance, dynamic programming language. It is well-suited for high-performance numerical analysis and computational science.
  • To configure Julia for use in the Wolfram Language, follow the instructions from the Configure Julia for ExternalEvaluate workflow.

ExternalEvaluate Usage

  • ExternalEvaluate["Julia",code] executes the code string in a Julia REPL and returns the results as a Wolfram Language expression.
  • ExternalEvaluate["Julia""String",code] executes the code string in a Julia REPL and returns the output as a Wolfram Language string.

Data Types

  • The following Julia built-in types are supported:
  • BoolTrue | FalseBoolean True/False values
    Int8, Int16, Int32, etc.Integerinteger
    Float16, Float32, etc.Realreal number
    Complex{Float16}, Complex{Float32}, etc.Complexcomplex number (returning from Julia only)
    StringStringstring of characters
    ArrayListlist of objects
    DictAssociationassociative array
    SetListunordered set without duplicates
    TupleListfixed-length container
    nothingNullno return value

Usage Notes

  • String templates (<**>) can be used to evaluate and insert Wolfram Language expressions into the Julia code string.

Examples

open allclose all

Basic Examples  (1)

Evaluate 2+2 in Julia and return the result:

Arrays are returned as lists:

Type > and select Julia from the drop-down menu to get a code cell that uses ExternalEvaluate to evaluate:

map(sqrt, 1:1:10)

Scope  (1)

Start a session:

Concatenate strings in Julia and return the result:

Dictionaries in Julia are returned as associations:

Close the session:

Introduced in 2020
 (12.1)