23 October 2011

Prospects for virtual life: Is Java a Wittgensteinian language?

Several years ago I wrote an article saying that Object-Oriented Programming (OOP) looked a lot like the Platonic vision of the world and wondered whether a Wittgensteinian programming language could be created. From the article:
...although at ground level OOP is still actually made of loops and conditions, it sure looks different from a programmer's point of view. In case of OOP you have to deal with so called objects (such as a button or a window or a menu or whatever you invent) and these objects have properties, events and methods.

Traditional programming was causal, while OOP is intentional. Traditionally, you would tell the computer something like: "Do this, then that, if the user does that go that way, if (s)he does that other thing go the other way, then enter this loop and continuously check and check and check whether the user has done anything you have plans for, and God forbid (s)he does something unexpected, and so on." Usually, you would have to predict any possible action the user could do and devise a certain response.

In OOP you are not programming in such a causal manner, you are actually setting various purposes or functions to various objects. You say "The purpose of this button over here is to open up that window", "The purpose of this text box is to get some text from the user." And so on. This allows you to create much more complex programs in a more bug-free manner.

A property is how the object looks like. For example, it has a certain color, or a certain text imprinted on it, or has a certain position inside a window and so on. When you change the value of some property, the object miraculously changes its appearance. You're just saying "I want you to be like that", and it becomes like that.

An event is something that can happen to the object. For example a button can be clicked. Or the mouse can go over it. A text can be changed. Etc. You, as a programmer, can say to an object: "If this event ever happens to you, this is how I want you to react."

A method is something that the object can do. While events are things inflicted on objects, methods are the things the objects themselves do. For instance, a text box can undo a text change or can copy the selected text to Clipboard.

What's fun from a philosophical point of view is that this OOP creates a very platonic virtual world. Plato's most famous idea is that everything in the real world, everything that we see and ourselves included, is only a sort of copy of some "archetypal" or ideal object. In the same way, every object OOP deals with is created from a so-called class. A class is the ideal, platonic object. A class consists in a set of properties without a specified value, having empty events and methods. To create a particular virtual object (that you can actually see on screen or with what you can actually do anything) you assign certain values to the ideal object (to the class), and write some code for its events and methods.

The class defines in a sort of abstract manner what all the possible objects of that type could be like. A class doesn't define a particular button, but defines the concept of any button. Translating Plato into OOP language: he believed the true world is the world of classes only, while the world of objects is only apparent (he used the following metaphor: objects are like the shadows of the classes, and we are only seeing these shadows, wrongfully taking them for real). In other words, he believed God was a computer programmer that did the job in a divine Visual Basic.

The philosopher most famous for debunking Plato's vision of the world is Wittgenstein. Wittgenstein's most famous idea is that objects in the real world are not the outcome of some platonic classes, but that they come in "families". A family is a set of real objects that resemble each other from various points of view. For example, the family "chair" is a set of all the objects that we call by that name. But we group together these objects in one single family, not because they share some common essence, but out of historic accidents. For example, in Romanian a toilet seat is called a "toilet chair" (because Romanians read sitting on the toilet more often than the English). To Romanians the toilet seat is part of the "chair" family, while the English have a more restrictive concept of "chair".

For describing his idea, Wittgenstein used the metaphor of a rope: a rope is made of many fibers, but there's no fiber that has the same length as the entire rope. In the same way, object A resembles object B, which resembles object C, and which, in turn, resemble object D, and all these objects may be part of the same family, but nonetheless, object A may not resemble object D in any dramatic manner. In other words, there's no common thread through all the objects called by a certain name - i.e. belonging to a certain family.

I've been wondering how a Wittgensteinian programming language would look like. Suppose the buttons and all the windows you could encounter in this virtual world would not arise from certain classes, but they would belong to a family. I think the virtual world would be much more diverse and fun, and, probably, any programmer's nightmare.

In order to create a new object, you would have to take an existing object and modify it in various ways. But there would not be any predetermined class to tell you in what ways you may modify it - a predetermined concept of "all" objects of that type. I guess such a Wittgensteinian standard would be great for the open source programs.

I've noticed now that someone made an interesting comment that Java can be seen as an example of such a Wittgensteinian language:

Maybe JavaScript is more of a Wittgensteinian language. It has three big differences compared to C++, C# and Java: First, there's no distinction between objects and classes; new objects are created not by instantiating classes but by copying existing objects. Second, it uses duck typing -- instead of checking whether an object is derived from a particular class, you check whether it has a given property or method. Third, there's no enforced encapsulation; properties and methods can be added or changed from without.

It seems to me that this is an important threshold, much more important than the transition from traditional programming to OOP. The reason is that evolution by natural selection works in a Wittgensteinian language. For instance, all living beings form a large Wittgensteinian family created by biological evolution - different species exist because extinction has created gaps in the threads of family resemblances that link living beings one to another, and not because members of a species are instantiations of an abstract class (this was Darwin's main insight, see Dennett 1995, chapter 2 for details). Once a Wittgensteinian programming language is available (e.g. Java), one can develop genuine evolution by natural selection in the virtual world. Java would be the equivalent of DNA.

I'm thinking of the following thing. Right now all programs are the result of intelligent design, i.e. each new program is the result of some human programmer making the changes in order to achieve some desired goal (such that the program serves some desired function). However, with a Wittgensteinian language it is possible in principle to eliminate the programmer entirely, and just let programs evolve under the selection pressure of users' demands. For example, right now many programs collect crash reports and improvement suggestions from users, but actual human programmers need to sift through all these reports and decide what changes to make. An Darwinian alternative to this system would involve an automatic meta-program sift through the reports, operate changes in the program and test the program (the alpha version) against a set of users willing to serve as testers (as it commonly already happens).

Biological evolution provides another important suggestion: the meta-program can be written in the same language as the program. In case of life, DNA is not enough to make a living being, DNA has to be transcribed into the proteins that actually make up the creature by some enzymes - but these enzymes are themselves proteins, and, as such, the information about how to make them is also coded in the DNA. This is a loop. The consequence of this loop is that not only life forms change, but also the mechanism for building life forms can change (and it did change - these are known as the "major transitions in evolution", see Maynard Smith & Szathm√°ry, Carroll, or Kirschner & Gerhart).

Applied to the virtual world of computer programs, this idea would mean that the program that sifts through user reports and which operates the changes in existing programs developing new versions can itself be written in Java (or in some other Wittgensteinian language), and, as such, can also be subjected to evolution by natural selection. This would thus become a self-contained system for developing better and better (i.e. in line with users' demands) computer programs without any need for human computer programmers.

20 October 2011

Lenin on state capitalism

From "Session of the All-Russia C.E.C.", 1918:

When I read these references to such enemies in the newspaper of the Left Communists, I ask: what has happened to these people that fragments of book-learning can make them forget reality? Reality tells us that state capitalism would be a step forward. If in a small space of time we could achieve state capitalism in Russia, that would be a victory.

How is it that they cannot see that it is the petty proprietor, small capital, that is our enemy? How can they regard state capitalism as the chief enemy? They ought not to forget that in the transition from capitalism to socialism our chief enemy is the petty bourgeoisie, its habits and customs, its economic position. The petty proprietor fears state capitalism above all, because he has only one desire—to grab, to get as much as possible for himself, to ruin and smash the big landowners, the big exploiters. In this the petty proprietor eagerly supports us.

Here he is more revolutionary than the workers, because he is more embittered and more indignant, and therefore he readily marches forward to smash the bourgeoisie—but not as a socialist does in order, after breaking the resistance of the bourgeoisie, to begin building a socialist economy based on the principles of firm labour discipline, within the framework of a strict organisation, and observing correct methods of control and accounting—but in order, by grabbing as much as possible for himself, to exploit the fruits of victory for himself and for his own ends, without the least concern for general state interests and the interests of the class of working people as a whole.

What is state capitalism under Soviet power? To achieve state capitalism at the present time means putting into effect the accounting and control that the capitalist classes carried out. We see a sample of state capitalism in Germany. We know that Germany has proved superior to us. But if you reflect even slightly on what it would mean if the foundations of such state capitalism were established in Russia, Soviet Russia, everyone who is not out of his senses and has not stuffed his head with fragments of book learning, would have to say that state capitalism would be our salvation.

I said that state capitalism would be our salvation; if we had it in Russia, the transition to full socialism would he easy, would be within our grasp, because state capitalism is something centralised, calculated, controlled and socialised, and that is exactly what we lack: we are threatened by the element of petty-bourgeois slovenliness, which more than anything else has been developed by the whole history of Russia and her economy, and which prevents us from taking the very step on which the success of socialism depends. Allow me to remind you that I had occasion to write my statement about state capitalism some time before the revolution and it is a howling absurdity to try to frighten us with state capitalism.

First principles


Thou shalt have no other gods before me.


When everyone knows good as goodness, there is already evil.

05 October 2011

This is bad: the slowdown of technological growth

Peter Thiel:

The fading of the true Green Revolution — which increased grain yields by 126 percent from 1950 to 1980, but has improved them by only 47 percent in the years since, barely keeping pace with global population growth


Looking forward, we see far fewer blockbuster drugs in the pipeline — perhaps because of the intransigence of the FDA, perhaps because of the fecklessness of today’s biological scientists, and perhaps because of the incredible complexity of human biology. In the next three years, the large pharmaceutical companies will lose approximately one-third of their current revenue stream as patents expire, so, in a perverse yet understandable response, they have begun the wholesale liquidation of the research departments that have borne so little fruit in the last decade and a half.