News for hackers. Stuff that matters.
Re:F (2006) by DylanDmitri on Friday August 21, 2020 @08:43PM (#24240539)
In loopless Python:

    set(open('file_b')) - set(open('file_a'))
Slower than J by a factor of 2-3, but still 10x faster than grep:

    real    0m0.128s
    user    0m0.078s
    sys     0m0.063s
This would make a good Rosetta Code prompt.
Re:F (2006) by throwaway_pdp09 on Saturday August 22, 2020 @04:02AM (#24242541)
I didn't know you could simply open a file and setify it. Interesting. & neat.
Re:F (2006) by fennecfoxen on Saturday August 22, 2020 @08:06AM (#24243566)
You can setify any iterable. File handles are iterables that return a line at a time. Tada!
Re:F (2006) by throwaway_pdp09 on Saturday August 22, 2020 @08:58AM (#24243818)
> File handles are iterables...

I did not know that. Assumed you had to somehow wrap them first. Very useful, thanks!

Re:F (2006) by qmmmur on Friday August 21, 2020 @09:31PM (#24240814)
this is cheeky, I like it
Re:F (2006) by dunefox on Saturday August 22, 2020 @06:20AM (#24243116)
This is only fast because it hits C underneath, isn't it?