FLOW (programming language)

Last updated
FLOW
Paradigm Non-structured, imperative
Designed by Jef Raskin
First appeared1970;53 years ago (1970)
Influenced by
BASIC

FLOW is an educational programming language designed by Jef Raskin in 1970 and implemented on several minicomputers in the early 1970s. The goal of the language is to make it easy to explore algorithms through a highly interactive environment. The overall language is very similar in syntax and structure to the BASIC programming language, but has a number of changes in order to make typing code easier. Most notable among these was the concept of "typing amplification", in which short strings, often a single character, were expanded by the language into the complete "unamplified" source code. Modern integrated development environments and code-oriented text editors often include a similar feature, now normally referred to as autocomplete. The beginning programmer would first create a flow chart to solve the problem. Since all of the problems involved words (rather than mathematical problems) the solution was intuitive. The flow chart would be translated into the flow programming language using a top-down, mechanical method.

Contents

History

In 1970, the English Department of the University of Kansas hosted a meeting on the use of computers in the humanities. The conference was followed by a training session that ran from June 13 to August 18, where Jef Raskin was one of several teachers involved in training other teachers basic computer skills. During this period, Raskin developed the FLOW language concept. [1]

A key design element of FLOW was the attempt to avoid syntax errors by automating the entry of the language as much as possible. For instance, if one wanted to enter the statement PRINT "10", the user simply had to type P10 and the interactive editor would expand it out as they typed. If the user entered an illegal command, it would flash on the terminal and then be automatically erased so the user was "none the worse for hitting a wrong key". They referred to this concept as "typing amplification", and noted that it had the added advantage of removing an impediment for slow typers or those with physical problems using a terminal. [2]

Lewis and Norman later referred to this concept as "gag", in that it gagged the user's input until they typed something useful. They illustrated this by recounting one of Raskin's favorite demonstrations of FLOW, where he would close his eyes and hit random keys on the terminal, building a syntactically correct, albeit meaningless, program. [3]

Another aspect of the FLOW system's approach to user interaction was its debugger. This included the command WALK, an analog to BASIC's RUN that delayed after executing each statement in a fashion similar to modern single-step systems. [4] [3]

On his return to University of California, San Diego (UCSD), Raskin was able to arrange funding from UCSD and matching funds from the National Science Foundation to purchase equipment to develop the FLOW system, a total of $76,000 (equivalent to $572,703in 2022). [5] The initial system consisted of three Data General Nova minicomputers with 12k words of memory, several VST 1200 terminals, a Tektronix 4002 graphics terminal, and an HP 7200 plotter. In September 1973 the CPUs were updated to 32k words of memory. [6]

The first version of FLOW was programmed by Jonathan "Jon" Collins in FORTRAN for use at the summer institute. To facilitate a quick implementation (1 week), Jonathan restricted input to the first character of the command with the computer supplying the balance of the command letters. Hence, typing amplification was invented. Flow was later ported by two UCSD graduate students to Nova assembler language. Later ports included MICRO 800 assembler, BASIC and Algol. [6]

Description

Overall organization

Like BASIC, FLOW uses line numbers both as an editing aid as well as statement labels. Unlike most BASICs, FLOW automatically numbers programs starting at line 10 and incrementing by 10 as new lines are entered. The line numbers are formatted as three digits, so line 10 is displayed as 010. Users can also enter line numbers manually, and renumber the entire program with the NUMBER command. [5]

In contrast to BASIC, the RUN command can be instructed to stop once a given line was reached, for instance, RUN FROM FIRST LINE TO 200. To enter this command, the user simply types RF200, with the rest being "amplified" into the command line. [5]

Syntax and capabilities

The most obvious difference between FLOW and BASIC was that FLOW has only one variable, IT, and lacks mathematical operators. The language has only seven statements, all of which apply basic logic or string manipulation. There is no equivalent of the for loop either, looping is handled entirely through IF tests and JUMP TO statements. [7]

The language does not have direct user interaction like BASIC's INPUT, data is instead defined in FLOW's analog of BASIC's DATA statement, TEXT. TEXT IS defines a quote-delimited string, like TEXT IS "HELLO,WORLD", which is then read character-at-a-time using the GET IT. IT is a meta-variable that contains the last read character, and can then be used in other statements, like PRINT IT. IT becomes a blank -not an empty string but a single space- when the TEXT is completely read. [5]

Programs can contain multiple TEXT statements, but unlike BASIC's DATA where all of the lines are considered to be one continuous block of data, only one TEXT statement is active at a time as they are encountered by the interpreter. In other words, if there are two TEXT statements in a program, they are not treated as one longer statement as is the case with DATA, IT will return a blank when it runs off the end of the active TEXT statement and will not return more data until the next TEXT statement is encountered in the code. [5]

Statements

From: [8]

Program statements

COMMENT - equivalent to BASIC's REM
PRINT - as in BASIC, takes literal strings between double quotes, the IT variable, or ON A NEW LINE to print a carriage return.
TEXT IS - similar to DATA in BASIC, but used for strings only
GET IT - reads the next character from the current TEXT statement
JUMP TO - equivalent to GOTO, always expands target lines to three digits
IF IT IS ... JUMP TO - equivalent to IF...THEN but can perform only equality tests against IT
STOP - used to end a program, but not required

Interactive commands

RUN - as in BASIC but can define both the start and end lines and use meta-lines FIRST LINE and END
WALK - executes the program slowly
DISPLAY - equivalent to LIST. To list the entire program, one uses DISPLAY FROM FIRST LINE TO END
ERASE - remove lines from a program, ERASE FROM 038 TO 140
NUMBER - renumber the lines in the program

Example

010 COMMENT FIND IF A WORD HAS EITHER AN "F" OR A "G" IN IT 020 COMMENT BY LYRA FORET 19 OCTOBER 1971 030 COMMENT 040 COMMENT SOME TEST CASES ARE FOX, GOPHER, RAT, DOG, CAT 050 COMMENT THE RESPECTIVE ANSWERS SHOULD BE YES, YES, NO, YES, NO. 060 COMMENT 070 TEXT IS "DOG" 080 COMMENT OBTAIN A LETTER OF THE TEXT 090 GET IT 100 COMMENT CHECK FOR A BLANK WHICH INDICATES END OF WORD 110 IF IT IS " " JUMP TO 500 120 COMMENT CHECK FOR F'S OR G'S 130 IF IT IS "F" JUMP TO 200 140 IF IT IS "G" JUMP TO 200 150 COMMENT IT WAS SOME OTHER LETTER, SO GO ON TO THE NEXT CHAR. IN THE TEXT 160 JUMP TO 080 200 PRINT "THE WORD HAD AN 'F' OR A 'G' IN IT." 210 COMMENT WE ARE DONE 220 STOP 500 PRINT "THE WORD DID NOT HAVE AN "F' OR A 'G' IN IT."

Related Research Articles

<span class="mw-page-title-main">Text editor</span> Computer software used to edit plain text documents

A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software. Text editors are provided with operating systems and software development packages, and can be used to change files such as configuration files, documentation files and programming language source code.

Programmed Inquiry, Learning, or Teaching (PILOT) is a simple high-level programming language developed in the 1960s. Like its younger sibling LOGO, it was an early foray into the technology of computer-assisted instruction.

<span class="mw-page-title-main">Jef Raskin</span> American computer scientist (1943–2005)

Jef Raskin was an American human–computer interface expert who conceived and initiated the Macintosh project at Apple in the late 1970s.

<span class="mw-page-title-main">JOSS</span> Interactive programming language

JOSS was one of the first interactive, time-sharing programming languages. It pioneered many features that would become common in languages from the 1960s into the 1980s, including use of line numbers as both editing instructions and targets for branches, statements predicated by boolean decisions, and a built-in source-code editor that can perform instructions in direct or immediate mode, what they termed a conversational user interface.

Integer BASIC is a BASIC interpreter written by Steve Wozniak for the Apple I and Apple II computers. Originally available on cassette for the Apple I in 1976, then included in ROM on the Apple II from its release in 1977, it was the first version of BASIC used by many early home computer owners.

Commodore BASIC, also known as PET BASIC or CBM-BASIC, is the dialect of the BASIC programming language used in Commodore International's 8-bit home computer line, stretching from the PET (1977) to the Commodore 128 (1985).

Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time Sharing System (DTSS), it offered an interactive programming environment to all undergraduates as well as the larger university community.

In computing, a line number is a method used to specify a particular sequence of characters in a text file. The most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and incrementing by 1 for each successive line.

BASIC-PLUS is an extended dialect of the BASIC programming language that was developed by Digital Equipment Corporation (DEC) for use on its RSTS/E time-sharing operating system for the PDP-11 series of 16-bit minicomputers in the early 1970s through the 1980s.

FOCAL is an interactive interpreted programming language based on JOSS and mostly used on Digital Equipment Corporation (DEC) Programmed Data Processor (PDP) series machines.

MBASIC is the Microsoft BASIC implementation of BASIC for the CP/M operating system. MBASIC is a descendant of the original Altair BASIC interpreters that were among Microsoft's first products. MBASIC was one of the two versions of BASIC bundled with the Osborne 1 computer. The name "MBASIC" is derived from the disk file name MBASIC.COM of the BASIC interpreter.

HP Time-Shared BASIC is a BASIC programming language interpreter for Hewlett-Packard's HP 2000 line of minicomputer-based time-sharing computer systems. TSB is historically notable as the platform that released the first public versions of the game Star Trek.

Color BASIC is the implementation of Microsoft BASIC that is included in the ROM of the Tandy/Radio Shack TRS-80 Color Computers manufactured between 1980 and 1991. BASIC is a high level language with simple syntax that makes it easy to write simple programs. Color BASIC is interpreted, that is, decoded as it is run.

<span class="mw-page-title-main">Simons' BASIC</span>

Simons' BASIC is an extension to BASIC 2.0 for the Commodore 64 home computer. Written by British programmer David Simons in 1983, who was 16 years old at the time, it was distributed by Commodore as a cartridge.

IBM System/34 BASIC was an interpreter for the IBM System/34 midrange computer.

IBM System/36 BASIC was an interpreter for the IBM System/36 midrange computer.

Southampton BASIC System (SOBS) was a dialect of the BASIC programming language developed for and used on ICT 1900 series computers in the late 1960s and early 1970s; it was implemented as an incremental BASIC interpreter under the MINIMOP operating system at the University of Southampton and also ran under MAXIMOP.

<span class="mw-page-title-main">BASIC interpreter</span> Interpreter that enables users to enter and run programs in the BASIC language

A BASIC interpreter is an interpreter that enables users to enter and run programs in the BASIC language and was, for the first part of the microcomputer era, the default application that computers would launch. Users were expected to use the BASIC interpreter to type in programs or to load programs from storage.

BASIC-8, is a BASIC programming language for the Digital Equipment (DEC) PDP-8 series minicomputers. It was the first BASIC dialect released by the company, and its success led DEC to produce new BASICs for its future machines, notably BASIC-PLUS for the PDP-11 series. DEC's adoption of BASIC cemented the use of the language as the standard educational and utility programming language of its era, which combined with its small system requirements, made BASIC the major language during the launch of microcomputers in the mid-1970s.

CALL/360:BASIC was an IBM dialect of the BASIC programming language for the System/360 and later platforms. It was based on mid-1960s versions of Dartmouth BASIC but added a number of extensions. Most of these were related to file handling, which, at that time, Dartmouth lacked. It also added support for the mathematical symbols found on some IBM terminals, so that <= could be entered directly as . Differences are otherwise minor.

References

Citations

Bibliography

Further reading