Insight Scripting

Elide can attach GraalVM Insight scripts that observe guest execution without modifying your program. Insight scripts hook into source loading and execution events through a global insight object.

Attaching a script

The repeatable --insights global flag attaches one or more Insight scripts. The script language is selected from its extension: JavaScript (.js / .cjs / .mjs), TypeScript (.ts / .mts / .cts), or Python (.py). Because --insights is a global flag, it applies to any run form — a top-level source file, the run subcommand, or a --snippet — not only run:

bash
 elide --insights trace.js run app.ts     # attach to `run`
 elide --insights trace.py app.mjs        # top-level run, Python insight script

The insight global

Inside an Insight script, the insight object registers observers on guest execution — for example on source load, function enter / return, and expression watch points — as defined by the GraalVM Insight API. This lets a script trace calls, collect timing, or inspect values as the guest runs.

See also

  • GraalVM Insight manual: