Skip to content

Add means of debugging variables in Rust #714

@partylikeits1983

Description

@partylikeits1983

Feature description

Currently, debugging Miden Rust programs is a bit difficult. The simplest way currently to inspect a variable is via the assert_eq! macro:

let mut some_variable = 5;
// some_variable is updated to 6 somewhere
assert_eq!(some_variable, 6u32);

While this works, it interrupts program execution and is not ideal for inspecting multiple variables or complex state.

It would be very useful to have a Miden Rust-specific debug macro or function, similar to println!, that can emit the value of a variable at a particular point in execution without halting the program. For example:

debug_var!(some_variable); // hypothetically prints the current value

This would make debugging compiled Miden Rust code far more straightforward and efficient.

Benefits:

  • Inspect variables without breaking execution.
  • Simplifies debugging of complex programs.
  • Provides a familiar interface for Rust developers (println!-like).

Why is this feature needed?

This would make debugging Miden Rust programs much more straightforward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions