22 September 2007

Thoughts on the Future and the Continuation of Our Species

Ok. Let me preface this by saying that I've been reading Ray Kurzweil's new book and it's kind of getting me thinking too much about these things. That being said, let the insanity begin!

I've been thinking about what will happen over the next thirty years of my life. There will be a point at which machine intelligence and human intelligence merge, I believe, and become the same thing with one helping the other. That's the next step in an unstoppable exponential climb towards the Universe's ultimate destiny.

For one, what if we become, essentially, immortal? What if we can live as long as we care to? There won't really be a reason to keep perpetuating the species at that point, biologically speaking, but there will still be a reason to keep making newer and better machines. The process of evolution will have totally shifted from being a biological process to being a technological process. At this point, the only way to die would be to have your consciousness erased from the Universe somehow, and I'm not even entirely sure how that would work or if your consciousness proper would have made the jump into the information age with you. This fits nicely in with the idea that the current asymptotic progression of technology is a continuation of earlier biological processes (things like DNA, going from single-celled to multi-celled organisms, and fish evolving jawbones can be thought of as paradigm shifts the same way that the transistor and quantum computer can).

So, reproduction will no longer be the driving force of evolution. It will become a human-driven process completely, and we will control it with our own ingenuity. That's pretty awesome, but it reminds me of something that Louis Armstrong once said when the Pope asked him if he and his wife had children. He supposedly said, "No but we're sho' havin' a lot of fun tryin'." I think it's gotta be the lewdest joke that a Pope has ever laughed at. Anyways think about that a second to get what I'm talking about.

The other thing that I think about a lot lately is what's going to happen to the people who get left behind. The Singularity and the next age, and in fact this current information age, are first world phenomena still. The third world is just now getting online, beginning with China and moving along through Asia, South America, and now Africa. I have a feeling that the XO laptop and the One Laptop Per Child (OLPC) campaign will coincide neatly with all of these world events. The very notion of absolutely minimizing the price of a laptop is interesting in and of itself, but that it's happening right here, right now, is very special. I have a feeling that very few human beings younger than I am right now will be truly and completely left in the dust, except perhaps by choice (theirs or someone else's). This is all so inevitable, like a rising tide that is bringing us all up with it.

Keep looking forward, space cadets; I'll see y'all later.

20 September 2007

What Does Your Brain Look Like

Tess and I agree to swap minds for a day sometime whenever that's possible. I don't think she knows what she's getting into. This place is like the Thunderdome, 'cept two men enter and then no one leaves for like a week.

max thom stahl
1:30 hahahaha
1:30 what is your mind like.
1:31 If it were a house or a building, what would it be like inside?

1:31 organized and pretty
1:31 everything matches
1:31 and lots of chandeliers

max thom stahl
1:31 oh hehehe
1:32 Mine would be like a jungle with a bunch of ziplines between trees, and hookers, and blackjack, and chalkboards everywhere with all kinds of math notation written in bad handwriting all over them.
1:32 And lots of chandeliers.

08 September 2007

Things I Miss When Programming in PHP

Ok. This isn't meant to be an entry just about trash-talking PHP. It's more of an entry discussing what are the things that are missing from PHP with regards to database-driven web site development. I do like PHP and of all the languages I've used "in the wild" so to speak PHP is the one I've got the most experience with. Still, I've got a few bones to pick with it so there may be a little trash-talking involved here.

Lack of Functional-ness
My programming background is pretty heavy with cryptography and artificial intelligence, so I feel like I really shine when I'm programming in functional languages like Ocaml, Haskell, Lisp and to a limited extent Scheme. I've even been known to bust out with some Prolog where appropriate. I think it's completely unreasonable to expect a language like PHP to have things like functional currying or functional pattern-matching, but I don't think it's unreasonable to expect some amount of functional programming magic to be possible.

For one, recursion is a no-no in PHP because there is no tail recursion. This may change in the future, but it's a pain to do recursion in PHP anyway and you're better off with a while loop and a stack (which is what tail-recursion turns into on the machine code side anyway). That's a bit of a pain because there are certain processes which are intuitively recursive processes, and these should be workable that way without penalty. Though I have made recursive functions in PHP and used them in quasi-production environments, that's outside the best practices for the language and I would never do it if I knew the system running my code was short on memory. Also, even without ordinary memory limitations, PHP's runtime can be configured to limit stack and heap space artificially, so recursion can still be a bad thing on systems that have plenty of memory.

Another beautiful functional programming trick is mappings. I love mappings. I mentioned list comprehensions just earlier (without calling them that), but if I had to choose one or the other I'd choose mappings. In python, ocaml, haskell, lisp, scheme, ruby, and a few more languages, there is a syntax for "Take each item in this list, apply this function to it, and return me a list of the results". It sounds less useful than it really is, but this is an amazing tool that you can use for all kinds of magic. Right up there with mappings are functional folds, where you can say "Take the items of this list and put this operator or function between all the elements, tacking on this constant to the end; return the result of that whatever it is." For example if you folded the "+" operator with 0 as the constant, you'd get the sum of a list. This is also handy for taking a list of words and appending them all together into one big string. In Haskell and Ocaml you can fold on the left or on the right but watch out, 'cause the right-hand fold is not tail-recursive.

Cons Über Alles
Another problem is the Array construct in PHP, which doesn't actually behave like an array at all but instead works like a hash table. The problem here is that sometimes I have an array that I wish to access like a hash (random-access), but oftentimes I want something that behaves like a List. Lists in functional languages get turned into single or double linked lists in memory, which is just peachy. In Haskell (and, I believe with some magic, Ocaml), you can even have the tail links to these lists pointing to thunks of code that generate the remainder of the list on-demand. That's not necessary for PHP, but it would be really nice to be able to have some kind of data structure native to the language that behaves like a list (or, for all you functional space cadets, a cons). This falls into the same category as recursion, because lists (at least single linked lists) are inherently recursive structures. I miss them.

We <3>
There's no built-in support for regular expressions. Now, I know what you're thinking: there isn't any built-in support for them in Ocaml or Haskell or Lisp either. They're library functions in those languages. But you know what? In Ocaml I don't have to type a mouthful like "preg_replace()" when all I want to do is the same thing the s/// operator in perl does. I know that perl's syntax is confusing as hell to people who are unfamiliar with it (and also to some who are quite familiar with it) but why shouldn't common things like that be a symbol rather than a long-ass function name? While we're on the subject, why are all the functions in PHP so long? Seems there's gotta be an easier way to handle them all.

Get Out of the C++ Mentality
One of the really powerful features of Ruby that scared the bejesus out of me at first but I grew to love is the fact that you can, anywhere you want, add or remove functions or members from classes. This is really scary but really powerful. A lot of the cooler features of Ruby on Rails would be completely impossible without this. For instance you would not be able to have something like acts_as_authenticated or acts_as_taggable, which are functions that shove code from plugins into your existing classes. In PHP you have to have separate classes or subclasses to do this kind of work and it's kind of a pain. Why not just have code blocks hanging around that you can swap in and out of where you need them when you need them? This is, of course, because PHP is a C++ derivative and Ruby is a Smalltalk derivative. Both have their advantages, but this is one of those pure object-oriented things that should've crossed over.

Lemme see... what else. If I had any choice about it, I'd program web sites in Python or Ruby, but Python doesn't integrate very well that way, being that it doesn't have the inline HTML magic that PHP and Ruby both have. I'm still a little uneasy about the syntax of Ruby, too, even though it looks like it should be something very familiar to me (it looks like Ocaml sometimes). Meh. We'll see.

Ok. Back to work for me. Later, space cadets.

02 September 2007

The Sky, the Stars, and Everyday Life in the Age of Information

I just realized the other night that I and many others like me are, on a day to day basis, living out the wild acid-trip fantasies of futurists everywhere years ago. What prompted this was a week spending most of my free time (what little of it I've had) browsing Google Earth.

Seriously think about this for a second. I have an application on my computer (and, in a limited fashion, on my phone too) that allows me to look at aerial and satellite imagery from anywhere on the globe. I can overlay it with any set of metadata that I want, can see points on the Earth that other users have found interesting or that have historical significance, too. In my case, I was browsing the globe for the sites of atmospheric nuclear tests, because you can see their craters in satellite imagery (disappointingly enough the site of the 57 megaton Tsar Bomba blast is poorly imaged because, I imagine, no one can fly a plane there safely). In a certain bizarre way, detached both in time and in space, I was gazing at the sites of some of the world's worst mishaps. Chernobyl looks great from the air. Mayak, just northwest of Chelyabinsk, looks desolate and forgotten, a major nuclear catastrophe swept under the rug of the world (you've never heard of it, have you). Three Mile Island looks amazing. The giant crater in Bikini Atoll at the site of the Castle Bravo event is clearly visible, and you can view it without getting the lethal dose of radiation you'd receive at the surface after a couple of hours.

Information is not only free now, but it's everywhere, instantly accessible at every moment in our lives. We're surrounded by outlets for all manner of information all the time. And here fifty years ago people thought that Television was revolutionary! Think of it for a minute, though. Have you ever been having a conversation with someone, and in the back of your mind there's a topic that's related but you can't remember any details about it? Now you can just look it up, anywhere, any time. Amazing.

I can now browse the skies as if they were an open book I was reading. I can zoom into places I find interesting, look up whatever Messier objects I find nearby, find imagery in whichever spectrum I require. That feeling I used to get as a kid looking at the Universe's unbelievably infinite majesty isn't really dampened now, looking at imagery instead of the real world around me. I'm still painfully aware that we orbit Sol, one tiny little yellow star in the backwaters of a spiral arm in a giant galaxy. Our galaxy is one of an uncountable multitude, on an unstoppable collision course with the Andromeda galaxy. It's so impossible to think of how huge they are, too. Don't ever try; you'll hurt yourself. Just sit back in wonder, zoom in, and realize that that smudge you were looking at is actually billions of stars, and that thing you thought was a star is really a galaxy, containing even more stars.

It's hard to think of it this way, but we are furry little creatures on a tiny blue rock in a Universe that is so enormous we cannot even begin to conceive of it, even though it is finite. As I write this it expands, though, and space stretches even further. Our lives are so short; all of Human existence is less than the blinking of an eye to the Universe, but to us we feel so significant. The Universe's existence and our own are so deeply entangled that it's only too tempting to think that the Universe is the way it is so that we can observe it, and we can exist within it only because it is exactly as it is. The tiniest deviation at any time in the past 13 or 14 billion years would have produced an entirely different experience, or no experience at all. To me it's no wonder at all that people believe in God. It takes an even greater leap—not in faith, but in perception—to see that we're here because everything was exactly right for us to be here, and if it weren't then we wouldn't be around to ask those kinds of questions. That thought alone is enough to bring tears to my eyes some nights when I can't sleep for thinking about these things.

I remember as a kid reading 2001: A Space Odyssey and wishing so badly that I could be a Star Child, a being of pure energy so immortal that I could scoff at space and time themselves and explore the Universe at my whim. Maybe that'll be possible some day. For now, I'll just have to content myself with having imagery from the world's most powerful telescopes in space and on the surface being instantly available to me all the time. *sigh*

Later, space cadets.