Wednesday, July 04, 2007

Down the rabbit-hole

The notepad that you use on your computer to edit stuff is a good example of an editor. It is a program that allows you to write things on the computer. The letters that you type out are reflected on the computer screen and then saved as a file. An editor is a computer program like any other - a sequence of instructions written by a human programmer specifying what has to be done when the keys are pressed and how things have to be displayed and saved and the like. The point is that it is a computer program. What you see on the screen is what the program does. Programs, which I described as being sequences of instructions to the computer, are written by human programmers using editors. (So notepad was written using an editor)

I was on the way back after losing a racquetball match (least unusual) and walking beside the lake towards our lab. I do not know for certain if it were the ducks or the breeze that caused me to ask that particularly inappropriate question. How did they write the first editor program? I was in a light mood, you can see. Well… by pencil on paper I’d say, said my friend who’d won the match. And? How did it get on to the computer? I could hardly help asking. They must have scanned and OCRed it ofcourse he said. Being in an equally light mood helped. That was a wonderful answer. An OCR or an optical character recognizer is a horrendously complex program that recognizes written characters and makes it understandable to the computer. Wait a minute, I said. But how did they write the OCR program? Suppressing a laugh, he said, You shouldn’t ask such questions.

Thankfully, we were both kidding and it all ended in a hearty laugh. The specifics of the programs that came before notepad happened were not really important. It also didn’t matter that we did not know the real answer. What ever that might have been, it had to be something simpler than the OCR. Infact, punch cards were programmed by punching holes on cards. And you didn’t need already punched cards to do that. And there were a hundred other ways to input characters and record them. It didn’t really matter.

I went on a walk later that evening near the other side of the lake. Quite unusually, I saw a white rabbit with pink eyes. There was some weird deliberation in its ways. There was something about it that made me follow it. It might have sensed it. It ran soon towards the hole. I persisted. Surprisingly enough, the hole was quite big for the rabbit. Infact, big enough for me. And that was how I ended up in the rabbit hole.

I was only momentarily in the dark. Before I knew it, I was falling into what I thought was a bottomless pit before my bottom hit the bottom of the pit. I miraculously survived. Probably to meet a man who was at this coffee table. Before my lips could part, he said with a gentle smile- I’ve been waiting for you. I embarrassingly got up brushing off some hay that I had fallen on.

Without saying a word, he pushed a thick book towards me. It all was rather spooky and I didn’t think this was a place where you asked questions. He looked at me, and then at the book, as if asking me to read it. I opened it. It looked like a normal book. Except that for a book of its size, it started rather abruptly. In the beginning, the OCR was used to write the editor, I read softly, as if proving to him that I indeed was interested. I looked up. And he motioned me to carry on. Rabbit-hole or not, I don’t continue when I don’t understand. I said, it doesn’t make sense. Why not? he asked, not bothered in the least. I wanted to say isn’t it obvious, you moron.

Rather I said An OCR, is a program too, right? He agreed. How did they write it without an editor then? I asked, without sounding arrogant.

He sighed as if saying not another moron. He started: You see, a program is only made of 1s and 0s. I nodded. An OCR is a special sequence of 1s and zeros. It was there in the RAM (that’s computer’s memory, for the uninitiated) all the time.

But, I interrupted, how could it have got there in the first place?

He continued, not bothered at all, You see, it HAD to be there and it was. This book doesn’t talk of when it was not there. Obviously, it was always there.

It was my turn to explain now. Dear friend, you see computers did not always have keyboards. They did not always look like they do now and they did not always need an editor to program.

He jumped at the last line - You see you said it yourself. They did not always need an editor to program. So they would have written an OCR without an editor.

I counted to 10 and then started. An OCR, my friend is a program that is a thousand times more complicated than an editor. It is more likely that they would use an editor to write an OCR program rather than use an OCR to scan in an editor program. Infact, we have no OCRs good enough for the job now.

He jumped at the last line again. There, my friend, that is where you are missing the point. If there were not OCRs, how did they write the first editor program? Moreover, this book says it.

I wasn’t sure what he was made of. I thought he was a moron then. But I wasn’t expecting to lose an argument to a moron. I did lose though.

I started afresh: Computers did not always look like this. These things with keyboards and all are pretty recent.

He interrupted, You are wrong again my friend, this book says that the first computer was an Apple Machintosh and it came with an editor and more.

But Sir, I said almost dramatically, I know for a fact that that’s untrue. We have pictures and books about older computers. Infact we still have many around, though people don’t use them anymore.

And have you seen any of them?

Well sir, I’m afraid I haven’t. But Sir, it certainly could not have been the OCR…

He interrupted. Tell me, aren’t computers prone to stray magnetic noise?

Yes Sir. If they are of sufficiently high intensity, they can even flip some bits.

Exactly, my friend. So you see, it is not impossible for the OCR program to have existed in the RAM.

And how is that Sir?

Some magnetic noise might have switched the bits in the RAM exactly to create an OCR program.

But Sir, that’s extremely unlikely. In fact Sir, that is almost impossible.

I like that word son, he said, triumphantly. The word “almost” I mean. That means that you cannot say for sure that that did not happen, right?

No Sir, I cannot.

So it is perfectly plausible that the OCR program was created without using an editor. And that an OCR was indeed used to write the first editor, as this book says?

Yes Sir, it is not impossible.

And you have personally not seen any of these old computers without keyboards, have you?

No Sir, I haven’t.

I don’t know if it was triumph I saw or relief in his eyes as he left with his book.

I walked back to where I’d fallen and looked up the hole. This place was too far below. And I missed the lake and the ducks and the breeze.

2 comments:

Gary said...

Nice, man. But not really for the layman i suppose. Gets a little technical here and there. Nice stuff but.

Harish Srinivasan said...

Thanks to OCR, you could write this blog!!