pnkfelix / krabcake

Umbrella repository for Krabcake experiments
Other
46 stars 1 forks source link

kc: Create kc_as_raw macro and update related test #24

Closed bryangarza closed 1 year ago

pnkfelix commented 1 year ago

I don't want us to let debugging output leak into our tests, and I do not want to use std::fmt::Debug formatters for customer visible output.

think of it this way: Use std::fmt::Display for output that we are going to commit to keeping stable (and thus are willing to embed and maintain in our test suite). Use std::fmt::Debug for internal output, which we could maintain in our test suite, but the vast bulk of our test suite should not rely upon (because we want the flexibility to adjust the std::fmt::Debug output when necessary in the course of investigation or refactoring, etc.)

bryangarza commented 1 year ago

Makes sense, I can update this PR

pnkfelix commented 1 year ago

(because we want the flexibility to adjust the std::fmt::Debug output when necessary in the course of investigation or refactoring, etc.)

One idea here that we may want to look into: in rustc, there is a -Z verbose=... flag that, IIRC, could be used in part to change how ASTs nodes and types were printed out. So we might consider making our std::fmt::Display code change its behavior based on the presence of a -Z flag like that (but here I mean such a flag would be passed to the valgrind krabcake tool at invocation time, not at compile time for krabcake nor the input program).