Future 101 - What is Programming, Anyway?

Cogs from a reconstruction of Charles Babbage's Difference Engine, the predecessor of the Analytical Engine. Note the decimal system instead of binary.

Cogs from a reconstruction of Charles Babbage's Difference Engine, the predecessor of the Analytical Engine. Note the decimal system instead of binary.

Surely, many can identify with the following scenario:

You're incredibly fascinated about where the world is going tech-wise. There's Facebook planning a virtual and augmented reality takeover, there are autonomous cars driving passengers around in Pittsburgh (though not quite as smoothly as expected), hackers seizing computer systems around the world and demanding ransom in bitcoin, cyber warfare and autonomous armed drones, big data influencing elections, electronic athletes and virtual sports events with millions of dollars in prizes... But, you ask, what exactly is the computer anyway? What is the internet? What about all these acronyms we use daily in our online worlds -- HTTP, URL, HTML, bits, bytes, what have you...

I'm determined to find out how all of it works, what it is, and where it's going, and to share my progress here. To start with, I figured it'd be useful to just dive in and learn some programming, as that's what everything is based on. So I did.

The first thing to know is that, ultimately,  the computer is a physical thing. Though it processes information in binary form, in ones and zeros, these are actually physical states of the circuitry. A component of the machine can have two distinct states, say, electrical current on or off -- symbolized by 1 or 0, respectively. In the olden, mechanical days of Babbage's analytical engine, the 19th century computer, the machine states were manipulated by directly  inserting punched cards, which then moved certain pegs and levers powered by steam.

By now, a lot has changed in practice, if not as much in principle. Everything is electrical, and nearly nano-scale, but the basic idea of storing certain information and manipulating it according to certain programs remains. What's new is what the users and the programmers interact with - the interface. 

To control the physical states of the computer, programmers use what is called an interpreter (or, a compiler; the difference needn't concern us here). An interpreter is like the interpreter translating between humans: It takes in one language, translates it, and outputs another language. In the case of a computer, the interpreter transforms what is called a programming language into the ones and zeros the computer can use.

These programming languages, therefore, are a kind of halfway house between pure physical information and natural human language. A certain language is directly and relatively easily readable by a human who has studied it; yet a programming language is fixed in its syntax (its structure) and semantics (vocabulary), so as to enable the interpreter to transform the programmers messages into "computerese."

By way of example, here are the first lines of code I wrote (in a language called Python) and gave to the interpreter. See if you can decipher how the little program works:

    print ("What's your name, darling?")
    myName = input()

    if myName == "Vinski" or myName == "Vinski Valos":
        print ("Hello, my creator, " + myName + "!")
        print ("It's good to meet you again!")
    else :
        print ("Hi there
," + myName + "! Am I supposed to know you?")

The so-called hardcoded vocabulary of Python includes signs such as the brackets, numbers, the colon, the doubled equation sign, and quotes, as well as keywords such as "print," "if," "else" and "input()" The interpreter recognizes these as it follows the program from top to bottom, and and tells the computer to work accordingly.

As you may have guessed, the "print" command first makes the computer show the bracketed question on the screen (or to print it on a piece of paper, 1950s style). The input command, then, allows the user to type in their name. Depending on the answer (effected by the commands "if" and "else") the program either greets you as its creator, or inquires how you reached the program in the first place.

In principle, all applications, webpages, programs from maps to photoshop to word processing, video games, and social networks all work according to this same idea -- only with much more complexity and finesse.

The beauty of computer programming is its universality. The interpreter itself is a program designed by someone, allowing others to use it as a tool to program things that themselves may work as tools for someone else with no programming knowledge themselves.

Programmed computers are a chain of ever simpler-to-use and more specified tools, ranging from the pure machine states via programming interfaces to the end user creating, for instance an image on Photoshop.

So far, these chains of interfaces have been getting longer, as technology has developed. First programmers of mainframe computers were the end users themselves, and since then, all kinds of intermediary services have simplified computer usage and made it accessible for people with different levels of proficiency. For instance, webpages can nowadays be programmed without any programming knowledge using a mediating service that employs pre-coded templates and parameters for personalization.

The ultimate stage, of course, would be a natural-language programmable interface -- an interpreter able to understand not only code bound by strict rules, but also imprecise and ambiguous human speech or movement, and program the computer accordingly. 

***

Here's the complete python program, press the  play arrow to start. You can also try and modify the code on the left to change the program.

 

 

 

 

 

 

 

http://alpha.editor.p5js.org/full/Sk5mebRJZ

Comment

The Natural and the Artificial

Are these plants nature?

Are these plants nature?

 

The Natural and the Artificial

The smart-alecky twelve-year-old I was, I'd fight the concept of nature. 

I demanded that skyscrapers, shopping malls, cars, trains, and space shuttles be included. Humans are part of nature! After all, we, the creators of this industrial wonder world, are animals, too, made up of cells just like every critter in the forest. And we decompose back into these elemental parts after our bout with phenomenal consciousness is over. Earth to earth, ashes to ashes, right? 

Let's see and whip out a definition (compiled from OED and Wiktionary):

Natural, adj.; Nature, noun

1. All things unaffected by, or predating, human technology, production and design
2. The basic or inherent features, character, or qualities of a thing. That what it will tend towards by its own constitution
3. Conformity to what is natural, as opposed to artificial, forced, or removed from actual experience.

The implications are plain -- whatever humans meddle with forfeits its naturalness. At this point, I could just accept this as a linguistic quirk: to elevate themselves from the rest, humans invented a word only to describe everything but themselves and their junk. Yet, I want to go deeper and pinpoint the difference between the Natural and the Artificial. Let's take a gander at the other side of the coin.

Artificial, adj.; Artifact, noun

1. Made or produced by human beings rather than occurring naturally, especially as a copy of something natural. 
(of a situation or concept) not existing naturally; contrived or false.

2. (of a person or their behaviour) insincere or affected.

What exactly is it that makes human products artificial instead of natural? Why exclude the the smooth and brown "artifacts" you flush down the toilet every day? Is sweat nature, what about semen? Is a heart transplant an artifact? Obviously, the definitions suggest we take up the words of action: 

"Made or produced."
"Human technology, production and design."

The question about definitions transformed into a question about human action. What is the relevant sense we make a rocket as opposed to "making" a functioning heart for ourselves as we develop in our mothers' wombs, or "making" a piece of number two after a cup of coffee? 

Passed a couple of years of insisting rockets are nature, I gave some thought to atoms and molecules. If there are such things as "natural laws," and molecules "obey" them and are predictable, and if we are just piles of molecules, doesn't that mean we can be predicted too? This epiphany blew up my teenaged brain -- everything was physics, everything was nature (the Greek φύσις means nature, that what has grown), and, suddenly, everything seemed simple. 

Gradually, however, the euphoria abated. A sun of existential confusion dawned on me: what would happen with freedom, with meaning, with purpose, with experience? I sweated.

This, it seems, is the distinction. Nature is what happens, artifacts are what humans freely make and give meaning and purpose to. Our bodily actions are involuntary, whereas space engineers decide to apply for NASA, decide to go to work every day, decide to keep clicking their computers, racking their brains, and assembling the rocket parts.

It all remains very mysterious. What does deciding mean?

Stay Tuned

-- Vinski

 

 

 

Comment