News for hackers. Stuff that matters.
Re:The Yoda of Silicon Valley by lizmat on Sunday December 23, 2018 @06:12PM (#18749039)
Just for reference: a Perl 6 version:

    sub MAIN($limit = Inf) {
        my %bag is Bag = words.map(&lc);
        say "{.key}\t{.value}" for %bag.sort( {
          $^b.value cmp $^a.value || $^a.key cmp $^b.key
        } )[^$limit]
    }
And for what it's worth, the `words` function is lazy, so it won't read all of the words into memory first.
Re:The Yoda of Silicon Valley by b2gills on Tuesday December 25, 2018 @01:53AM (#18756324)
I would have written the sort differently

    %bag.sort({ -.value, .key })