3 ms·
It basically runs transformation passes over the code until they stop changing the code or break its behaviour. It seems like a small number of the passes are
by IshKebab 2y ago
It basically runs transformation passes over the code until they stop changing the code or break its behaviour.
It seems like a small number of the passes are not specific to C:
https://github.com/csmith-project/creduce/blob/master/creduce/creduce.in#L767-L938 https://github.com/csmith-project/creduce/blob/master/creduc...
`"C" => 1,` means it is only for C.
I would guess `pass_lines` is the most important for non-C code; I'm guessing (it's written in unreadable Perl) that it removes lines.
So while it can work for languages other than C, most of its features are C-specific so it's not going to work nearly as well. Still I'd never heard of C-Reduce; pretty cool tool!
Someone make one based on Tree Sitter, quick!
- the8472 2y agoどうぞ https://langston-barrett.github.io/treereduce/ https://langston-barrett.github.io/treereduce/
- IshKebab 2y agoAh very cool!
- codesnik 2y agounreadable perl?! I clicked on the link expecting something super-terse and unstructured, but it's anything but. What the hell is wrong with people casually dropping such remarks.
- dazed_confused 2y agoBecause if you aren’t writing in python or JS/TS then it is gibberish. Not like Perl is used all throughout Linux system…