It looks like you're new here. If you want to get involved, click one of these buttons!
ELIZA was developed in 1966 using the MAD computer programming language and the SLIP Application Programming Interface (API). The ELIZA code has several parts to it in execution;
Using current standards, the code is simply awful. However looking at code at that time it is a wonder. Going back to this time we see that programs, languages, compilers, and data were all developed with a particular computer in mind. In the general sense, nothing was portable between computers or between operating systems, on the same or different computers. Portability often consisted of a rewrite, sometimes in the same computer language, often in another.
There was no need to construct some general API because programs were stand-alone creatures. A generalized API would serve no purpose, and in addition, other developers on the same computer using the same operating were typically unaware of some generalized interface and would probably not use one if aware. SLIP was a departure. It was a generalized API used, and rewritten, for multiple computers and in multiple languages. Although different implementations were different, the general functionality of the original SLIP was preserved. This was an innovation.
The concept of a a computer storing (and executing) a program from memory was relatively new. The idea that a program was a 'dumb' calculator that used data as its preemptive force was novel. The ELIZA control logic is the 'dumb' program. It has no mechanism for dealing with user input other than that provided by it's data, the script. Using a piece of data to define the interactive, or non-interactive, execution of a program was novel. Programs at that time were stand-alone creatures which had an internal state which controlled behavior, not externally supplied data.
So, why was the code awful (by current standards)? Except for the MAD conditional (WHENEVER, OR WHENEVER, OTHERWISE, END WHENEVER) the concept of a block does not exist. Idealization of code into code 'blocks' is absent, instead, if you wanted to execute some piece of code within a function, you branched to it (TRANSFER(. And much like FORTRAN at this time, ELIZA contains an uncontrolled collection of branches. This makes the understanding of what is happening problematical, and for us here and now, very difficult. Modern computer science understands this, and advises against just these constructs.
So, what makes this code worthwhile? Other than the novelty of using input data to drive program language, the entire ELIZA program is about 420 lines long. It created and impact when written; it had an impact after it was written; it remains with an impact now. How could such a small program have such a large influence? And that makes it worthwhile as a subject of investigation. It can be looked at with respect to historical computer science; it can be looked at to see if there are any societal interests contained as part of its program - it's program style.
The attachment has the original ELIZA program written in MAD and commented on by Anthony Hay. Note that MAD is not a free-form language. On a punched card, columns 1 - 7 is reserved for a label, column 8 is reserved for a comment 'R' or a continuation mark, and columns 73 - 80 are typically used to contain a card number, the compiler ignores them.
Comments
Great @aschwarz Though its lengthy, I'm going to just paste the commented code in here hopefully to speed along commentary:
[Continued
[cont.]
I think it's also useful to look at our project website: http://findingeliza.org. Click on "code" to see a slightly nicer formatting for the code and also you can try out a version of ELIZA.
This isn't an analysis of the code exactly, but one very interesting development in the history of Eliza happened ten years ago, nearly fifty years after ELIZA was released. Very, very few programs have had such enduring legacy.
In 2014, @ElizaRBarr was created. This twitter bot, as you may have noticed from the name, was programmed to use ELIZA to come up with responses to tweets. But the novel application here was as a honeypot. You see, GamerGate was going on, which was largely a harassment campaign against several folks who were trying to bring feminist (and other) critiques against video games. One way in which this campaign played out was in endless arguments on Twitter. So, someone (I don't believe we ever found out who) decided that @ElizaRBarr would reply to people using the #gamergate hashtag. In this fashion, it was like a DDoS against the time and attention span of the harassers; every minute they'd talk to the bot would be a minute they would not be harassing a human.
@ElizaRBarr was very successful in this endeavor, with some people engaging with it for hundreds of replies before realizing they'd been duped.
I am wondering when ELIZA is going to pop up again.
Eliza has an enduring legacy; if gives the appearance of participating in a dialog, and it is fairly simple to code.
The fascination lies in that people with no apparent effort, get 'trapped' into a dialog with a person, the Eliza Effect, and then pass this fascination on to others. The dialog becomes a game in which users communicate with others about their interactions. I wonder if the interaction is self-modifying. Whether users consciously avoid forcing Eliza into seeming to be a machine rather than a person. whether their is an avoidance of sentences and phrases which force the machine to act as a machine. This might be an interesting area to investigate.
The other audience are the software developers who in their turn may be fascinated at both the dialog (with a 'person') and the simplicity of the code. A thought that they could create a 'person' simply. And the prospect of causing themselves and others to be fascinated at the end result.
Probably off topic: I asked Le Chat "Can I give you some computer code and you can explain what it does? I want a highly detailed explanation of each line" and then gave it this fragment of code from the SLIP library used by Weizenbaum for ELIZA:
and this is what it gave me:
This code appears to be written in MAD (Michigan Algorithm Decoder), which is an old programming language used mainly for list processing on IBM mainframe systems. I'll provide a detailed explanation of each line:
PARTN
- This is the name of the MAD program (PARTition Nodes).MAD
- This indicates that the code is written in the MAD programming language.EXTERNAL FUNCTION(SLST,PART,SIGNAL)
- This line declares an external function with three parameters:SLST
(a list),PART
(an array), andSIGNAL
(a value used as a tag).NORMAL MODE IS INTEGER
- This line sets the normal mode for the program to be integer, which means that the program will primarily work with integer values.ENTRY TO PARTN.
- This line defines the entry point for the program, which isPARTN
.TAG=SIGNAL
- This line assigns the value of theSIGNAL
parameter to the variableTAG
.COUNT=0
- This line initializes the variableCOUNT
to 0.READER=SEQRDR.(SLST)
- This line initializes the variableREADER
with the value returned by theSEQRDR
function, which takes theSLST
parameter as input.SEQRDR
likely returns a sequential reader for the list.READ
- This is a label used for branching within the program.COUNT=COUNT+1
- This line increments the value of theCOUNT
variable by 1.DATUM=SEQLR.(READER,FLAG)
- This line assigns the value returned by theSEQLR
function to the variableDATUM
.SEQLR
likely reads an item from the list using theREADER
and stores the result inDATUM
. TheFLAG
variable is used to indicate the status of the read operation.W'R FLAG .G. 0, T'O DONE
- This line checks if theFLAG
variable is greater than 0. If it is, the program branches to theDONE
label.W'R LNKL.(DATUM) .E. 0
- This line checks if the left link of theDATUM
is equal to 0. If it is, the program continues to the next line.PART(COUNT) = DATUM
- This line assigns theDATUM
value to theCOUNT
-th element of thePART
array.T'O READ
- This line branches to theREAD
label, creating a loop that continues reading and processing items from the list.O'E
- This is the "otherwise" clause for the previous conditional statements, executed if none of the previous conditions were met.W'R NAMLST.(DATUM) .NE. 0, T'O PLAIN
- This line checks if theNAMLST
value associated with theDATUM
is not equal to 0. If it is not equal to 0, the program branches to thePLAIN
label.W'R TOP.(DATUM) .NE. TAG, T'O PLAIN
- This line checks if theTOP
value associated with theDATUM
is not equal to theTAG
. If it is not equal to theTAG
, the program branches to thePLAIN
label.COUNT=COUNT-1
- This line decrements the value of theCOUNT
variable by 1.LSSCPY.(DATUM,LIST.(IT))
- This line copies the contents of theDATUM
to a new list item at the index specified by theIT
variable.POPTOP.(IT)
- This line removes the top item from the list specified by theIT
variable.MAKEDL.(IT,PART(COUNT))
- This line creates a doubly-linked list with theIT
variable as the first item and theCOUNT
-th element of thePART
array as the second item.IRALST.(IT)
- This line inserts the list specified by theIT
variable into the main list.T'O READ
- This line branches to theREAD
label, continuing the loop.PLAIN
- This is a label used for branching within the program.NEWBOT.(DATUM,LIST.(PART(COUNT)))
- This line creates a new bottom item for the list specified by theDATUM
and links it to the list item specified by theCOUNT
-th element of thePART
array.ATTCH
- This is a label used for branching within the program.W'R READER .GE. 0, T'O READ
- This line checks if theREADER
variable is greater than or equal to 0. If it is, the program branches to theREAD
label.LNKBOT.(SEQLR.(READER,FLAG),PART(COUNT))
- This line links the bottom item of the list specified by theREADER
to theCOUNT
-th element of thePART
array.T'O ATTCH
- This line branches to theATTCH
label, creating a loop that continues linking items in the list.E'L
- This is the "end loop" statement, which terminates the loop.DONE
- This is a label used for branching within the program.COUNT=COUNT-1
- This line decrements the value of theCOUNT
variable by 1.PART(0)=COUNT
- This line assigns the value of theCOUNT
variable to the first element of thePART
array.F'N COUNT
- This line returns the value of theCOUNT
variable as the result of the function.E'N
- This is the "end" statement, which signifies the end of the program.This MAD program appears to process a list, partitioning its nodes based on certain conditions and storing the results in the
PART
array. The specific functionality may depend on the exact implementation of the list and the associated functions used in the code.--
It's really not bad. I think most statements are correct, but 23 is wrong: IRALST deletes the list IT. I asked it to give a high level summary of the function and it was pretty impressive, saying in part:
Please do take a look at our project website for more information about our work on ELIZA findingeliza.org