Stream: general

Topic: deICEing

Giles Cope (Jul 10 2019 at 07:56, on Zulip):

Has anyone already written a program that takes rust source, replaces some {...} with {unimplemented!()} and checks it gets the same compiler error message and repeates? I feel like there should be a deice tool that I can run on some code that ICEs to minimise it before I try and do it manually. (I'm sure there's other applications of a tool such as that). Is there one already I can use / improve or do I get to code one up?

Giles Cope (Jul 10 2019 at 08:44, on Zulip):

next question will be is there a robust (can handle errors well) ast manipulation tree available? I should probably look at rust fix shouldn't I... that changes rust code.

lqd (Jul 10 2019 at 09:25, on Zulip):

c-reduce kinda works on simple rust code, it'd be amazingly useful if it supported more

Jake Goulding (Jul 10 2019 at 13:21, on Zulip):

There was something recently...

Jake Goulding (Jul 10 2019 at 13:22, on Zulip):

Jake Goulding (Jul 10 2019 at 13:23, on Zulip):

fuzzy-pickles has a mutable AST visitor

Jake Goulding (Jul 10 2019 at 13:26, on Zulip):

one of my future ideas is a "regex on steroids" where you can say like s/$x = $x + $y/\0 += \1 (made up, unrealistic syntax)

Jake Goulding (Jul 10 2019 at 13:27, on Zulip):

To be able to do customized code transforms, something I envy from other languages.

lqd (Jul 10 2019 at 13:41, on Zulip):

or maybe you can adapt @pnkfelix's "everybody loops" to randomize which body to turn into a loop :)

oli (Jul 10 2019 at 18:24, on Zulip):

I just reviewed a master thesis on a "regex for asts" and we're gonna integrate it with clippy

oli (Jul 10 2019 at 18:25, on Zulip):

You can find an early version in the clippy PR list (search for pattern or RFC)

Jake Goulding (Jul 10 2019 at 18:48, on Zulip):

Well, I guess I could have gotten a Masters. I always assumed all my ideas were ones people had already done.

Jake Goulding (Jul 10 2019 at 18:50, on Zulip):

And of course, now it is done, so I'm back in the same state

lqd (Jul 10 2019 at 19:06, on Zulip): is one of the best at that AFAICT, rust support for that would also be amazing (but I've been told by someone who worked on it that it wouldn't be easy etc)

Giles Cope (Jul 24 2019 at 08:22, on Zulip):

Rust-reduce includes everybody loops among other things. It worked well to bring a large project down to something much more managable.

Last update: Jul 16 2020 at 15:20UTC