JuliaInterpreter v0.12.0
Added
RecursiveInterpreterinterprets the code passed toCore.eval, also through
Base.eval,@eval, andinclude, in top-level frames linked to the
calling frame, so breakpoints, stepping, and exception handling extend into
it. To evaluate it natively, useNonRecursiveInterpreteror add the method
ofCore.evaltoJuliaInterpreter.compiled_methods
(#783).
Changed
- Breaking:
Frame(mod, ex)now evaluates:moduleexpressions as native
evaluation does: each evaluation creates a fresh module instead of re-entering
an existing one of the same name,__init__runs (natively) after the body,
and the statement evaluates to the module, also when the module expression
comes from a macro.Frame(mod, :(module X end))no longer createsXwhen
the frame is constructed, and returns a frame inmod.ExprSplitterkeeps
re-entering existing modules and does not run__init__. On Julia 1.10–1.12,
__init__may run out of order or twice when the parent module is itself
being evaluated natively, e.g. from a package's top-level code
(#782). - Breaking: On Julia 1.12 and later, top-level frames advance their world
only at:latestworldstatements, as native evaluation does, rather than
before every statement, andFrame(mod, ex)andFrame(mod, src::CodeInfo)
start in the latest world by default. Code that evaluates top-level frames
selectively must still advance the world at the:latestworldstatements it
skips (#783). - A top-level statement driven by
Frame(mod, ex)that fails to lower throws
the error of native evaluation (e.g.syntax: invalid assignment location)
instead of anArgumentError(#783). :son a top-level statement driven byFrame(mod, ex)enters the lowered
frame of the statement like a callee and stops at its first call, instead of
entering the callee of the surface call expression, which failed when the
call's arguments contained calls and skipped the rest of the statement, such
as the assignment ofx = f(1)(#784).
Fixed
- The frame of a nested
:thunkin top-level code, as lowered for closures, is
linked to its caller, so breakpoints, errors, and its value propagate
(#783).
Merged pull requests: