Quotations I

"As far as anyone knows, there's never been an animal population that was stable in the absence of predation, famine, or disease."

"Don't get discouraged," Carla said, reaching over and putting a hand on his shoulder. "That's just the history of life for the past few eons. It's not as if it's a law of physics."

The Eternal Flame by Greg Egan

Continue reading

Quicksort in FIM++

Dear reader, I have got to tell you, fandom is intense. One day last October Equestria Daily (internet clearinghouse for fans of the animated series My Little Pony: Friendship Is Magic) posts a joke proposal for a programming language (FIM++) based on the show, and within the week there's a working interpreter for it. What does it mean to model a programming language after a cartoon, you ask? Well, in the show, episodes typically end with our heroine Twilight Sparkle (or after Season Two, Episode Three "Lesson Zero", one of her friends) writing a letter about what she's learned about the magic of friendship to her mentor (and God-Empress of the sun) Princess Celestia. So, then, why not have an esoteric programming langauge where the source code reads like a letter to Princess Celestia? Adorable, right?

So, this gift having been provided to us courtesy of Karol S. and the brony community, let's do something with it! More specifically, how about we implement quicksort?—that is a classic. What's quicksort? Well, we want to sort a list, right? So—bear with me—we define this partitioning procedure that, given indices into an array, partitions the subarray between those indices into a subsubarray of elements less-than-or-equal-to a given element dubbed the pivot, then the pivot itself, then a subsubarray of elements greater than the pivot. How do we do that? Well, let's designate the last element in our subarray as the pivot. Then we're going to scan through all the other elements, and if any of them are less-than-or-equal-to the pivot, we swap it into our first subsubarray and increment a variable keeping track of where the first subsubarray ends. Then, we swap the pivot into place and return its index. In Ruby—

Continue reading

Compensation

"Maybe there should be an effort to cryopreserve specimens of endangered species. 'Hey, sorry we killed your entire species, but when we get more computing power later, we'll be sure to give you lots of happy runtime as compensation.'"

Guns

"Do you know, I've decided I like guns. Of course it would be preferable to wave a magic wand and have all sentient life live in peace and harmony in paradise forever. But if Reality puts you in a situation where you have to kill, at least we have tools to do it quickly: a well-aimed bang and there isn't a creature there to suffer for very long. That's actually a huge improvement over the state of nature, where animals kill with nothing but teeth and claws."