4 ms·
A simple program reducer for any language
- egonschiele 6y agoI hadn't heard the concept of a reducer. Very cool!
- macintux 6y agoErlang QuickCheck, and I would guess Haskell as well, offers a reducer. It’s really quite impressive. Any John Hughes talk is worth watching; here’s one where he demonstrates the functionality. https://youtu.be/gPFSZ8oKjco https://youtu.be/gPFSZ8oKjco
- FeepingCreature 6y agoThere's also DustMite for D. https://dlang.org/blog/2020/04/13/dustmite-the-general-purpose-data-reduction-tool/ https://dlang.org/blog/2020/04/13/dustmite-the-general-purpo... It's fairly D specific though. I've submitted dozens of bugs with it. It's pretty great.
- TacticalCoder 6y agoSo does Clojure's test.check. Even though Clojure ain't typed you can define "specs" of your data and then have generators generating random data (it's not the only use of specs: they can also be used as a way to verify inputs to functions). The generators data can be used to, say, quickly create fake database with lots of data or fed into test.check which then does fuzzy testing and then tries hard to reduce failing test cases to minimal cases.
- yudlejoza 6y agoI hadn't either. But I refer to the method as 'code isolation'. There are a bunch of related stuff that's interesting: - code slicing (known as code-splitting in JS community). - round-trip compilation
- pabs3 6y agoC-Vise and C-Reduce are common ones for C/C++: https://github.com/marxin/cvise https://github.com/marxin/cvise http://embed.cs.utah.edu/creduce/ http://embed.cs.utah.edu/creduce/
- eatonphil 6y agoComby looks great. I've been wondering recently why there isn't a mature tool for both language agnostic lining and transforms. I started using semgrep for linting various languages but I just as soon want to run transformations. Maybe Comby is what I'm looking for for both cases.
- hinkley 6y agoIs this the same basic principle as the back half of property based testing? Winnowing the example down to the critical components?
- Conlectus 6y agoThe full thing would be an example of property based testing, I believe, based on the property "the compiler doesn't crash".
- anitil 6y agoIs anyone else having difficulty viewing this on firefox? I'm getting a HSTS error.
- brutal_chaos_ 6y agoNot an issue on Nightly for Android 11.
- tgv 6y agoNo problem.
- jedisct1 6y agoVery cool stuff! And exactly what I was looking for when hitting compiler errors in Zig. Thank you!
- rmdashrfstar 6y agoDoes it work for Rust?
- Sophistifunk 6y agoI will pay good money for a `mergetool` built around Comby.
- drran 6y agoYep, comby did good job for me by reducing 10 kB Rust program, which crashes 2 months old nightly compiler, to 5.5 kB minimal one. Not sure is I should report this bug.
- wiml 6y agoComby looks nice, I miss the "tops" tool from the old MacOSX ecosystem. 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 https://github.com/dsw/delta [2] https://tracker.debian.org/pkg/delta https://tracker.debian.org/pkg/delta [3] https://en.wikipedia.org/wiki/Delta_debugging https://en.wikipedia.org/wiki/Delta_debugging