The love that dare not speak its name

As astute readers may have noticed, I've recently cultivated a sort of giant-squid beat here at Collision Detection. Now another fascinating bit of squid trivia has just come across the transom.
As you may know, no giant squid has ever been observed alive; we've only ever recovered dead carcasses. But according to the BBC, a bunch of scientists have figured out a way to lure a male giant squid to the surface: By tempting him with squid genitals. The scientists have apparently been saving cephalapod unmentionables for some time, to use as bait. As one explains:
"The freezer bag at home -- to my wife's disgust -- is actually full of giant squid gonad samples. We're going to grind all of this up, and we're going to have this puree coming out from the camera, squirting into the water. Hopefully the male giant squid, absolutely driven into a frenzy, is going to come up and try to mate with the camera.
"This is the dream - we're going to get this sensational footage of the giant squid trying to do obscene things with the camera."
(Thanks to Jessica's Peace Dividend for finding this one!)
Posted by Clive Thompson at November 20, 2003 12:25 AM
| TrackBack
This back and forth is an important concept to understand in C programming, especially on the Mac's RISC architecture. Almost every variable you work with can be represented in 32 bits of memory: thirty-two 1s and 0s define the data that a simple variable can hold. There are exceptions, like on the new 64-bit G5s and in the 128-bit world of AltiVec
When a variable is finished with it's work, it does not go into retirement, and it is never mentioned again. Variables simply cease to exist, and the thirty-two bits of data that they held is released, so that some other variable may later use them.
Since the Heap has no definite rules as to where it will create space for you, there must be some way of figuring out where your new space is. And the answer is, simply enough, addressing. When you create new space in the heap to hold your data, you get back an address that tells you where your new space is, so your bits can move in. This address is called a Pointer, and it's really just a hexadecimal number that points to a location in the heap. Since it's really just a number, it can be stored quite nicely into a variable.
When Batman went home at the end of a night spent fighting crime, he put on a suit and tie and became Bruce Wayne. When Clark Kent saw a news story getting too hot, a phone booth hid his change into Superman. When you're programming, all the variables you juggle around are doing similar tricks as they present one face to you and a totally different one to the machine.
Since the Heap has no definite rules as to where it will create space for you, there must be some way of figuring out where your new space is. And the answer is, simply enough, addressing. When you create new space in the heap to hold your data, you get back an address that tells you where your new space is, so your bits can move in. This address is called a Pointer, and it's really just a hexadecimal number that points to a location in the heap. Since it's really just a number, it can be stored quite nicely into a variable.
To address this issue, we turn to the second place to put variables, which is called the Heap. If you think of the Stack as a high-rise apartment building somewhere, variables as tenets and each level building atop the one before it, then the Heap is the suburban sprawl, every citizen finding a space for herself, each lot a different size and locations that can't be readily predictable. For all the simplicity offered by the Stack, the Heap seems positively chaotic, but the reality is that each just obeys its own rules.