[swift-users] Swift creduce

Huon Wilson huon at apple.com
Wed Apr 19 19:29:44 CDT 2017


Sorry, I was inaccurate: there’s also some syntactic constructs that don’t get minimized as much as they could because they’re too “complicated". The most common one I’ve noticed is instance variable without defaults: creduce doesn’t seem to be able to coordinate removing both declaration and the later initialization at the same time, and it’s invalid to remove either one individually.

However, I’ve found doing one run of creduce, followed by some hand editing to tease out any those sort of dependencies remaining (including just replacing function bodies with fatalError()), lets a second run finish the job. Alternatively, after the first run, the code is often small enough that one can just do the rest by hand without a second run.

Huon

> On Apr 19, 2017, at 17:21, Huon Wilson via swift-users <swift-users at swift.org> wrote:
> 
> No; Swift just looks C-like enough that many of the various heuristics creduce has still work reasonably efficiently. Unless one's “good or not” script is doing something weird, the areas where creduce doesn’t understand Swift are ignored, because the compiler output is not going to match what the script is checking for.
> 
> The main downside of it not understanding Swift is that it is likely to be slower than on C, since it’ll be wasting its time on some mutations that will very very rarely be interesting.
> 
> Huon
> 
>> On Apr 19, 2017, at 17:16, Doug Hill <swiftusers at breaqz.com> wrote:
>> 
>> Ok, that's unexpected. Does creduce know about Swift now?
>> 
>> Doug Hill
>> 
>> 
>>> On Apr 19, 2017, at 5:13 PM, Slava Pestov <spestov at apple.com> wrote:
>>> 
>>> Huon noticed that creduce actually works pretty well with Swift as-is. I’ve been using it without any issues.
>>> 
>>> Slava
>>> 
>>>> On Apr 19, 2017, at 3:53 PM, Doug Hill via swift-users <swift-users at swift.org> wrote:
>>>> 
>>>> Is there a version of 'creduce' for Swift?
>>>> 
>>>> I did some basic googling and didn't find anything, so I thought I'd ask here.
>>>> 
>>>> Thanks.
>>>> 
>>>> Doug Hill
>> 
> 
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users



More information about the swift-users mailing list