From b6ed224e76eadec463aadd46fb43f4226bb13854 Mon Sep 17 00:00:00 2001
From: Marc Vertes
interp.Eval(`print("hello", 2+3)`)The following figure 1 displays the main steps of evaluation:
The corresponding AST is:
This is the raw AST, with no annotations, as obtained from the @@ -254,7 +254,7 @@ form in the Go compiler. In yaegi, no IR is produced, only AST annotations are used.
Let’s use our previous example to explain:
In the AST, the nodes relevant to the CFG are the action @@ -289,7 +289,7 @@ code also performs dead branch elimination and condition validity checking. At this stage, in terms of Control Flow, our AST example can now be seen as a simpler representation, such as the following.
The character of universality here lies in the cyclic nature of the @@ -352,7 +352,7 @@ directly on Go interfaces (more precisely their reflect representation), hiding a lot of low level processing and subtleties provided by the Go runtime.
The memory management performed by the interpreter consists of -- cgit v1.2.3