Saturday, January 17, 2009

I can get along very well without such a program

Computers are so commonplace nowadays, many people do not understand why they are so useful.

Here is the rub, computers understand nothing but two numbers, a “1” and a “0”. They are just, when all said and done, a bunch of switches that are either “on” (a “1”) or “off” (a “0”).l

Humans do not see this level, All we see are games, photos, movies, etc.

But the real reason computers work is that these very zeroes and ones can be looked upon in more than one way.

It is similar to the USE-MENTION distinction in English. To elaborate, the word “bubblegum” is a word. I don’t chew it. I just look at the word. However, I DO chew bubblegum. The quotation marks signify the “mention” of the word, as without them, the word is actually “used” in the sentence – I chew bubblegum. It describes an action.

“bubblegum” describes the word. Bubblegum describes the product.

Computers understand the 1s and 0s in at least four different ways, in the same way that bubblegum above is understood in two ways.

Here is a short computer program in the computer language AKIKOKAKOLA to do the sum 1 + 1 = 2:

0001 PROGRAM STUPID
0002 INTEGER x, y, z
0003 x = 0
0004 y = 0
0005 z = 0
0006 PRINT “Hi, this program adds 1 and 1”
0007 INPUT “Please type in 1”, x
0008 INPUT “Please type in 1 again”, y
0009 IF ((x = 1).AND.( y = 1 ))THEN CONTINUE ELSE GOTO 0002
0010 PRINT “Thank you for your input”
0011 z = x + y
0012 PRINT “The answer is “, z
0013 PRINT “Congratulations!”

Line 1 is the program name (STUPID because it just does 1 + 1 )

Line 2 introduces x, y and z.

Lines 3 – 5 starts them off at zero.

PRINT outputs text to the screen. INPUT does the same but accepts numbers as well. Lines 7 and 8 ask you to type in “1”

Line 9 is the most important, It is a test to make sure you have typed in the two “1”s. If you did, the program CONTINUEs. If you didn’t, it makes a jump back to line 2, and starts again.

The last two lines give the result, 2.

All the words above are represented inside the computer as 1’s and 0’s. Here is where the USE-MENTION distinction comes in, only with computers, there are more than two meanings to the 1’s and 0’s.

The “x”, etc are regarded as data, i.e. information (numbers). INPUT, PRINT, GOTO, etc are “commands”, i.e. instructions. The 0001, 0002, etc are locations in logical steps to be done one after the other.

The most important aspect of computers is in line 0009. The 1’s and 0’s that are in the computer are here to be regarded as “locations” to be “jumped” to, depending on if the “data” inside the “x” and “y” is correct or not. It is this capability to “jump” unique to computers, as opposed to calculators, that enables more complex calculations to be performed (such as 2 + 2 = 4)

The point is that a sequence of 1’s and 0’s can be regarded as representing a number (1), a character (i.e. letter), an instruction (GOTO) or a location (0002 or 0010).

That’s four, so to revert back to our English language analogy, it could be termed the NUMBER-CHARACTER-INSTRUCTION-LOCATION distinction.

This is the sole reason why computers are so powerful.

Incidentally, there is no such computer language as AKIKOKAKOLA, I made it up, but the program principles raised here can be implemented in FORTRAN, PASCAL, BASIC, LISP, and even COBOL (in COBOL, there would be at least 70 lines, as opposed to my thirteen)

The age of writing bespoke computer programs is largely dead now, for the simple reason ICL implemented a package in the late 1980’s called “Quickbuild”, which wrote it’s own programs.

Writing programs is now limited to scientists who need to design simulations based on the latest models of how something works, be it galaxy evolution, black hole physics, or even something as humble as quantum mechanics.

No comments: