Posts Tagged ‘smalltalk state’
What if you couldn’t turn it off and on again?
I blogged (ages) ago about how ’saving’ data in a computer is a bad idea. The concept of saving something in case it magically vanishes is new to electronic systems that store state as an internal electronic representation. During all of our human evolution, we’ve been in the situation that if you do ’something to something’ it changes it a bit, and you can’t go back. Cause and effect I guess… If you’re a carver and carve too much out of a bit of wood, it’s broken. If you’re a hunter and kill something, it’s dead. No going back, no un-carving or un-killing things.
Recently entering into the common lexicon is the phrase ‘turn it off and on again’, normally describing a computer that has broken somehow, and nobody can be bothered to work out what has happened, if it’s possible to anyway. So, turning it off and on again will restore some past state in its entirety, allowing you to carry on as if nothing bad has happened. Oh look, I just un-killed a gazelle!
Is this the right way of doing things?
Smalltalk is a programming language I have a lot of time for. Most programming languages seperate ’state’ from ‘code’. So a program boots, it gets told what it is by loading some state, then it springs into life. Assuming the program could understand the state, then it’s all ready to go. Why not kill it with a big frickin’ laser? Load it again, and it’s in the same state as it was when you killed it. Over and over you can restore state. Ok, so being able to do that isn’t inherently a bad idea as it’s one of the powerful things about computers, that you can ‘magically’ change things. One of the bad parts comes when you forget to save something, or something crashes. You don’t have a problem if something is written on paper; it doesn’t inexplicably vanish before your very eyes – unless you’re a 8 year old ’spy’ with one of those ‘invisible ink’ kits.
Smalltalk, and a number of other systems, were based on an ‘image’ which stored state. Similar to a ‘core dump’ which some may have seen when their computer barfs a load of crap onto the screen in the blue-screen death throes. Except for Smalltalk images are restartable, not just debugging data.
These kind of systems did require a larger overhead, so some weren’t convinced. But what would the electronic world be like now with solid state? Anything you do is fixed, and recoverable. Turning the machine off and on again would still present you with the same state. No get out, no turning back time…
Maybe programmers would be a bit more careful when hacking away at some wood, or is having a get-out clause a good thing?