#nushell-plugin #ir #instructions #representation #explore #jump

app nu_plugin_explore_ir

a nushell plugin called explore_ir

5 releases (breaking)

new 0.5.0 Nov 15, 2024
0.4.0 Oct 16, 2024
0.3.0 Sep 24, 2024
0.2.0 Aug 28, 2024
0.1.0 Jul 24, 2024

#376 in Debugging

Download history 11/week @ 2024-07-28 144/week @ 2024-08-25 10/week @ 2024-09-01 29/week @ 2024-09-15 178/week @ 2024-09-22 21/week @ 2024-09-29 4/week @ 2024-10-06 169/week @ 2024-10-13 15/week @ 2024-10-20 1/week @ 2024-10-27 2/week @ 2024-11-03 91/week @ 2024-11-10

115 downloads per month

MIT and maybe CC-PDDC

190KB
645 lines

nu_plugin_explore_ir

cargo install nu_plugin_explore_ir
plugin add ~/.cargo/bin/nu_plugin_explore_ir

This is a fancy viewer for internal representation (IR) code in Nushell. Example:

explore ir {
  if ($env.HELLO | is-not-empty) {
    "Hello, " ++ $env.HELLO ++ "!"
  } else {
    "Goodbye, " ++ (random uuid) ++ "!"
  }
}

An example of what the UI looks like for the above code

Key bindings:

Key Effect
q Quit the application.
SPACE Open the inspector, which shows debug info for the instruction.
g Go to a specific instruction by index.
or k Go to the previous instruction.
or j Go to the next instruction.
[ Go back after jumping to an instruction's target.
] Jump into an instruction's target (branch or call decl / block)
ESC Close a dialog box or prompt.

With the [ and ] keys it is easy to navigate through IR code and jump into blocks referenced by literals, (custom) declarations in call instructions, or branch targets.

Dependencies

~27–60MB
~1M SLoC