"Julia" (External Evaluation System)


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.


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: