TorchLean API

NN.Runtime.External.Julia

Julia subprocess integration (optional) #

This module provides a small wrapper around IO.Process for calling out to Julia.

Why this exists:

This mirrors the existing patterns used in TorchLean for:

Optional dependency:

References:

Resolving the Julia executable #

Resolve which Julia executable to use.

If the environment variable TORCHLEAN_JULIA is set, it takes precedence. Otherwise we fall back to juliaCmd (default: "julia"), which is expected to be on PATH.

Instances For

    Availability checks #

    Require Julia to be available and return the resolved command.

    This is suitable for example runners that want a friendly error message when Julia is missing.

    Instances For

      Running Julia #

      def Runtime.External.Julia.run (args : Array String) (cwd : Option String := some ".") (juliaCmd : String := "julia") :

      Run Julia with the given CLI arguments and return stdout.

      On nonzero exit code, we raise IO.userError including the captured stderr. The cwd defaults to "." so relative script paths behave like in other TorchLean subprocess integrations.

      Instances For
        def Runtime.External.Julia.runJson (args : Array String) (cwd : Option String := some ".") (juliaCmd : String := "julia") :

        Run Julia and parse stdout as JSON.

        Certificate producer scripts commonly print one JSON payload to stdout; this entrypoint checks the Julia process and parses that payload.

        Instances For