A simple program reducer for any language
comby.dev
comby.dev
Maybe Comby is what I'm looking for for both cases.
For a decade or so I've been using the "delta" tool for this[1,2], although it sometimes requires manual intervention to get an extremely small testcase because it has very little understanding of the source language's syntax. On the other hand, that genericness can be an advantage for custom languages and it's usually pretty fast at getting to the nut of the matter anyway.
(On the other hand, I don't have any evidence to suggest that a compiler bug report with a 5-line testcase gets looked at any sooner than one with a 1000-line testcase.)
Aside from "minimization" or "reduction" this technique is also sometimes called "delta debugging"[3].
[1] https://github.com/dsw/delta [2] https://tracker.debian.org/pkg/delta [3] https://en.wikipedia.org/wiki/Delta_debugging
And exactly what I was looking for when hitting compiler errors in Zig.
Thank you!
Any John Hughes talk is worth watching; here’s one where he demonstrates the functionality.
I've submitted dozens of bugs with it. It's pretty great.
https://github.com/marxin/cvise http://embed.cs.utah.edu/creduce/
There are a bunch of related stuff that's interesting:
- code slicing (known as code-splitting in JS community).
- round-trip compilation
Not sure is I should report this bug.