Speakeasy (computational environment)

Last updated

Speakeasy
Developer(s) Speakeasy Computing Corporation
Stable release
IV Iota / 2006
Written in Mortran, FORTRAN, C [ citation needed ]
Operating system Windows, macOS, RedHat Linux, SUSE Linux, Mandrake Linux, Debian, Solaris, HP-UX [1]
Type Technical computing
License Trialware
Speakeasy (the interpreted programming language)
Paradigm imperative
Designed by Stanley Cohen
Developer Speakeasy Computing Corporation
First appeared1964
Typing discipline dynamic
Influenced by
APL [2]
Influenced
MATLAB [3]

Speakeasy was a numerical computing interactive environment also featuring an interpreted programming language. It was initially developed for internal use at the Physics Division of Argonne National Laboratory by the theoretical physicist Stanley Cohen. [4] He eventually founded Speakeasy Computing Corporation to make the program available commercially. [5]

Contents

Speakeasy is a very long-lasting numerical package. In fact, the original version of the environment was built around a core dynamic data repository called "Named storage" developed in the early 1960s, [6] [7] while the most recent version has been released in 2006.

Speakeasy was aimed to make the computational work of the physicists at the Argonne National Laboratory easier. [8]

History

Speakeasy was initially conceived to work on mainframes (the only kind of computers at that time), and was subsequently ported to new platforms (minicomputers, personal computers) as they became available. The porting of the same code on different platforms was made easier by using Mortran metalanguage macros to face systems dependencies and compilers deficiencies and differences. [9] Speakeasy is currently available on several platforms: PCs running Windows, macOS, Linux, departmental computers and workstations running several flavors of Linux, AIX or Solaris.

Speakeasy was also among the first[ citation needed ] interactive numerical computing environments, having been implemented in such a way on a CDC 3600 system, and later on IBM TSO machines as one was in beta-testing at the Argonne National Laboratory at the time. By 1984 it was available on Digital Equipment Corporation's VAX systems. [10] [11]

Almost since the beginning (as the dynamic linking functionality was made available in the operating systems) Speakeasy features the capability of expanding its operational vocabulary using separated modules, dynamically linked to the core processor as they are needed. For that reason such modules were called "linkules" (LINKable-modULES). [12] They are functions with a generalized interface, which can be written in FORTRAN [13] or in C.[ citation needed ] The independence of each of the new modules from the others and from the main processor is of great help in improving the system, especially it was in the old days.

This easy way of expanding the functionalities of the main processor was often exploited by the users to develop their own specialized packages. Besides the programs, functions and subroutines the user can write in the Speakeasy's own interpreted language, linkules add functionalities carried out with the typical performances of compiled programs.

Among the packages developed by the users, one of the most important is "Modeleasy", originally developed as "FEDeasy" [14] in the early 1970s at the research department of the Federal Reserve Board of Governors in Washington D.C.. [15] Modeleasy implements special objects and functions for large econometric models estimation and simulation. [16] Its evolution led eventually to its distribution as an independent product.

Syntax

The symbol :_ (colon+underscore) is both the Speakeasy logo and the prompt of the interactive session.

The dollar sign is used for delimiting comments; the ampersand is used to continue a statement on the following physical line, in which case the prompt becomes :& (colon+ampersand); a semicolon can separate statements written on the same physical line.

$ supposeyouhaveaverylongstatement,$ youcanwriteitonmultiplephysicallinesusing"&"$ attheendofthelinetobecontinued: :_ the_return_value = this_is_a_function_with_many_arguments(argument_1, argument_2, &:&                             argument_3, argument_4, argument_5, argument_6)$ ontheotherhand,youcancollectseveralshortstatements$ onasinglephysicallineusing";":_ a=1; b=2; c=3; d=4

As its own name tells, Speakeasy was aimed to expose a syntax as friendly as possible to the user, and as close as possible to the spoken language. The best example of that is given by the set of commands for reading/writing data from/to the permanent storage. E.g. (the languages keywords are in upper case to clarify the point):

:_ GET my_data FROM LIBRARY my_project :_ KEEP my_data AS a_new_name_for_mydata IN LIBRARY other_project 

Variables (i.e. Speakeasy objects) are given a name up to 255 character long, when LONGNAME option is ON, up to 8 characters otherwise (for backward compatibility). They are dynamically typed, depending on the value assigned to them.

:_ a=1 :_ whatis a A is a REAL SCALAR. :_ a="now a character array" :_ whatis a A is a 21 element CHARACTER ARRAY.

Arguments of functions are usually not required to be surrounded by parenthesis or separated by commas, provided that the context remains clear and unambiguous. For example:

:_ sin(grid(-pi,pi,pi/32))    $ fully specified syntax

can be written :

:_ sin grid(-pi,pi,pi/32)     $ the argument of function sin is not surrounded by parenthesis

or even

:_ sin grid(-pi pi pi/32)     $ the arguments of function grid can be separated by spaces

Many other syntax simplifications are possible; for example, to define an object named 'a' valued to a ten-elements array of zeroes, one can write any of the following statements:

:_ a=array(10:0,0,0,0,0,0,0,0,0,0) :_ a=0,0,0,0,0,0,0,0,0,0 :_ a=0 0 0 0 0 0 0 0 0 0 :_ a=ints(10)*0 :_ a=10:

Speakeasy is a vector-oriented language: giving a structured argument to a function of a scalar, the result is usually an object with the same structure of the argument, in which each element is the result of the function applied to the corresponding element of the argument. In the example given above, the result of function sin applied to the array (let us call it x) generated by the function grid is the array answer whose element answer(i) equals sin(x(i)) for each i from 1 to noels(x) (the number of elements of x). In other words, the statement

:_ a=sin(grid(-pi pi pi/32))

is equivalent to the following fragment of program:

x=grid(-pi pi pi/32) $ generates an array of real numbers from -pi to pi, stepping by pi/32 for i = 1,noels(x)   $ loops on the elements of x   a(i) = sin(x(i))   $ evaluates the i-th element of a next i               $ increment the loop index

The vector-oriented statements avoid writing programs for such loops and are much faster than them.

Work area and objects

By the very first statement of the session, the user can define the size of the "named storage" (or "work area", or "allocator"), which is allocated once and for all at the beginning of the session. Within this fixed-size work area, the Speakeasy processor dynamically creates and destroys the work objects as needed. A user-tunable [17] garbage collection mechanism is provided to maximize the size of the free block in the work area, packing the defined objects in the low end or in the high end of the allocator. At any time, the user can ask about used or remaining space in the work area.

:_ SIZE 100M $ very first statement: the work area will be 100MB :_ SIZE      $ returns the size of the work area in the current session :_ SPACELEFT $ returns the amount of data storage space currently unused :_ SPACENOW  $ returns the amount of data storage space currently used :_ SPACEPEAK $ returns the maximum amount of data storage space used in the current session

Raw object orientation

Within reasonable conformity and compatibility constraints, the Speakeasy objects can be operated on using the same algebraic syntax.

From this point of view, and considering the dynamic and structured nature of the data held in the "named storage", it is possible to say that Speakeasy since the beginning implemented a very raw form of operator overloading, and a pragmatic approach to some features of what was later called "Object Oriented Programming", although it did not evolve further in that direction.

$ The following example shows how a Matrix-family object and an Array-family object $ with the same structure and values are operated on differently although using the  $ same "*" and "/" operator: in the first case using the matrix algebra and in the  $ second case operating on an element-by-element basis.
:_ a=matrix(2,2:1,2,3,4) ; a   A (A 2 by 2 Matrix)   1  2   3  4 :_ a*a   A*A (A 2 by 2 Matrix)   7   10   15  22 :_ a/a   A/A (A 2 by 2 Matrix)   1  0   0  1
:_ aa=array(2,2:1,2,3,4) ; aa   AA (A 2 by 2 Array)   1  2   3  4 :_ aa*aa   AA*AA (A 2 by 2 Array)   1   4   9   16 :_ aa/aa   AA/AA (A 2 by 2 Array)   1  1   1  1

The object families

Speakeasy provides a bunch of predefined "families" of data objects: scalars, arrays (up to 15 dimensions), matrices, sets, time series.

The elemental data can be of kind real (8-bytes), complex (2x8-bytes), character-literal or name-literal ( matrices elements can be real or complex, time series values can only be real ).

Missing values

For time series processing, five types of missing values are provided. They are denoted by N.A. (not available), N.C. (not computable), N.D. (not defined), along with N.B. and N.E. the meaning of which is not predetermined and is left available for the linkules developer. They are internally represented by specific (and very small) numeric values, acting as codes.

All the time series operations take care of the presence of missing values, propagating them appropriately in the results.

Depending on a specific setting, missing values can be represented by the above notation, by a question mark symbol, or a blank (useful in tables). When used in input the question mark is interpreted as an N.A. missing value.

:_ b=timeseries(1,2,3,4 : 2010 1 4) :_ b   B (A Time Series with 4 Components)   1  2  3  4 :_ b(2010 3) = ?  :_ showmval qmark :_ b   B (A Time Series with 4 Components)   1  2  ?  4 :_ 1/b   1/B (A Time Series with 4 Components)   1    .5   ?    .25 :_ showmval explain :_ b   B (A Time Series with 4 Components)   1     2     N.A.  4 :_ 1/b   1/B (A Time Series with 4 Components)   1     .5    N.C.  .25

In numerical objects other than time series, the concept of "missing values" is meaningless, and the numerical operations on them use the actual numeric values regardless they correspond to "missing values codes" or not (although "missing values codes" can be input and shown as such).

 :_ 1+?   1+? =  1.00  :_ 1/?   1/? =  5.3033E36  :_ 1*?   1*? = ?

Note that, in other contexts, a question mark may have a different meaning: for example, when used as the first (and possibly only) character of a command line, it means the request to show more pieces of a long error message (which ends with a "+" symbol).

:_ a=array(10000,10000:) ARRAY(10000,10000:) In line "A=ARRAY(10000,10000:)"  Too much data.+ :_ ? Allocator size must be at least     859387 kilobytes.+ :_ ? Use FREE to remove no longer needed data or use CHECKPOINT to save allocator for later restart.+ :_ ? Use NAMES to see presently defined names. Use SIZE & RESTORE to restart with a larger allocator. :_ ? NO MORE INFORMATION AVAILABLE.

Logical values

Some support is provided for logical values, relational operators (the Fortran syntax can be used) and logical expressions.

Logical values are stored actually as numeric values: with 0 meaning false and non-zero (1 on output) meaning true.

:_ a = 1 2 3 4 5 :_ b = 1 3 2 5 4 :_ a>b   A>B (A 5 Component Array)   0  0  1  0  1 :_ a<=b   A<=B (A 5 Component Array)   1  1  0  1  0 :_ a.eq.b   A.EQ.B (A 5 Component Array)   1  0  0  0  0 :_ logical(2) $ this changes the way logical values are shown :_ a>b; a<=b; a.eq.b   A>B (A 5 Component Array)  F F T F T   A<=B (A 5 Component Array)  T T F T F   A.EQ.B (A 5 Component Array)  T F F F F

Programming

Special objects such as "PROGRAM", "SUBROUTINE" and "FUNCTION" objects (collectively referred to as procedures) can be defined for operations automation. Another way for running several instructions with a single command is to store them into a use-file and make the processor read them by mean of the USE command.

Use-files

"USEing" a use-file is the simplest way for performing several instruction with minimal typed input. (This operation roughly corresponds to what "source-ing" a file is in other scripting languages.)

A use-file is an alternate input source to the standard console and can contain all the commands a user can input by the keyboard (hence no multi-line flow control construct is allowed). The processor reads and executes use-files one line at a time.

Use-file execution can be concatenated but not nested, i.e. the control does not return to the caller at the completion of the called use-file.

Procedures

Full programming capability is achieved using "procedures". They are actually Speakeasy objects, which must be defined in the work area to be executed. An option is available in order to make the procedures being automatically retrieved and loaded from the external storage as they are needed.

Procedures can contain any of the execution flow control constructs available in the Speakeasy programming language.

Programs

A program can be run simply invoking its name or using it as the argument of the command EXECUTE. In the latter case, a further argument can identify a label from which the execution will begin. Speakeasy programs differs from the other procedures for being executed at the same scoping "level" they are referenced to, hence they have full visibility of all the objects defined at that level, and all the objects created during their execution will be left there for subsequent uses. For that reason no argument list is needed.

Subroutines and functions

Subroutines and Functions are executed at a new scoping level, which is removed when they finish. The communication with the calling scoping level is carried out through the argument list (in both directions). This implements data hiding, i.e. objects created within a Subroutine or a Function are not visible to other Subroutine and Functions but through argument lists.

A global level is available for storing object which must be visible from within any procedure, e.g. the procedures themselves.

The Functions differ from the Subroutines because they also return a functional value; reference to them can be part of more complex statement and are replaced by the returned functional value when evaluating the statement.

In some extent, Speakeasy Subroutines and Functions are very similar to the Fortran procedures of the same name.

Flow control

An IF-THEN-ELSE construct is available for conditional execution and two forms of FOR-NEXT construct are provided for looping.

IF (logical-expression) THEN    true-block [ELSE    false-block] END IF
FOR index = min, max [, step]    loop-block NEXT index
FOR value IN set-of-valuesloop-block NEXT value

A "GO TO label" statement is provided for jumping, while a Fortran-like computed GO TO statement can be used fort multiple branching.

... IF (logical-expression) GO TO label ... label: ...
$ In the following statement  $ selector must be >= 1 and <= N  GO TO label1, label2, ..., labelN : selector  ... label1: ... label2: ... ... labelN: ...

An ON ERROR mechanism, with several options, provides a means for error handling.

Linkule writing

Linkules are functions usually written in Fortran (or, unsupportedly, in C). With the aid of Mortran or C macros and an API library, they can interface the Speakeasy workarea for retrieving, defining, manipulating any Speakeasy object.

Most of the Speakeasy operational vocabulary is implemented via linkules. They can be statically linked to the core engine, or dynamically loaded as they are needed, provided they are properly compiled as shared objects (unix) or dll (windows).

Notes

  1. Supported platforms
  2. Rubinsteyn, Alex (2014). Runtime Compilation of Array-Oriented Python Programs (PDF) (Ph.D.). New York University. APL directly inspired Speakeasy
  3. "An interview with CLEVE MOLER Conducted by Thomas Haigh On 8 and 9 March, 2004 Santa Barbara, California" (PDF). Computer History Museum. Retrieved December 6, 2016. So APL, Speakeasy, LINPACK, EISPACK, and PL0 were the predecessors to MATLAB.
  4. "An introduction to Speakeasy - Informal report
  5. Holl, Jack M.; Hewlett, Richard G.; Harris, Ruth R. (1997). Argonne National Laboratory, 1946-96. University of Illinois Press. p. 482. ISBN   978-0-252-02341-5.
  6. "Named storage: a dynamic storage-allocation scheme with manipulative routines", AEC research and development report - Volume 7021 ANL (Series) - Stanley Cohen, Physics Division, U.S. Atomic Energy Commission, Argonne National Laboratory, 1965.
  7. "Speakeasy - An evolutionary system", S. Cohen, Proceedings of the ACM SIGPLAN symposium on Very high level languages (March 1974)
  8. Cohen, Stanley (1971). "The Delphi-speakeasy system. I. Overall description". Computer Physics Communications. 2 (1): 1–10. Bibcode:1971CoPhC...2....1C. doi:10.1016/0010-4655(71)90008-7.
  9. "Using Mortran to translate Fortran programs from one machine to another" Steven C. Pieper, Argonne National Laboratory, 1976
  10. "Tame Your Mainframe". HARDCOPY . October 1984. p. 189.
  11. "Argonne Computing Newsletter: SPEAKEASY". 1988. p. 2526.{{cite web}}: Missing or empty |url= (help)
  12. "Speakeasy linkules - plug compatible software" ACM - Proceedings of the 1977 annual conference
  13. Cohen, Stan (1976). Speakeasy: a window into a computer. ACM Press. pp. 1039–1047. doi:10.1145/1499799.1499944. ISBN   978-1-4503-7917-5. S2CID   11997344.
  14. "Econometric models via SPEAKEASY/FEDEASY", James M. Condie, John W. Davison, 1975
  15. Renfro, Charles G. (2004). Computational Econometrics: Its Impact on the Development of Quantitative Economics. IOS Press. pp. 46–47. ISBN   978-1-58603-426-9.
  16. Renfro, Charles G. (2004). Computational Econometrics: Its Impact on the Development of Quantitative Economics. IOS Press. p. 373. ISBN   978-1-58603-426-9.
  17. The user can decide how often the garbage collections occur, in terms of number of objects created between two of them. This feature (SLOSH command) is actually aimed to linkules debugging.

Related Research Articles

In computer science, an array is a data structure consisting of a collection of elements, of same memory size, each identified by at least one array index or key. An array is stored such that the position of each element can be computed from its index tuple by a mathematical formula. The simplest type of data structure is a linear array, also called one-dimensional array.

C is a general-purpose computer programming language. It was created in the 1970s by Dennis Ritchie, and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of the targeted CPUs. It has found lasting use in operating systems, device drivers, and protocol stacks, but its use in application software has been decreasing. C is commonly used on computer architectures that range from the largest supercomputers to the smallest microcontrollers and embedded systems.

<span class="mw-page-title-main">Fortran</span> General-purpose programming language

Fortran is a third generation, compiled, imperative programming language that is especially suited to numeric computation and scientific computing.

<span class="mw-page-title-main">MATLAB</span> Numerical computing environment and programming language

MATLAB is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages.

PL/I is a procedural, imperative computer programming language initially developed by IBM. It is designed for scientific, engineering, business and system programming. It has been in continuous use by academic, commercial and industrial organizations since it was introduced in the 1960s.

In computer programming, a parameter or a formal argument is a special kind of variable used in a subroutine to refer to one of the pieces of data provided as input to the subroutine. These pieces of data are the values of the arguments with which the subroutine is going to be called/invoked. An ordered list of parameters is usually included in the definition of a subroutine, so that, each time the subroutine is called, its arguments for that call are evaluated, and the resulting values can be assigned to the corresponding parameters.

<span class="mw-page-title-main">NumPy</span> Python library for numerical programming

NumPy is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays. The predecessor of NumPy, Numeric, was originally created by Jim Hugunin with contributions from several other developers. In 2005, Travis Oliphant created NumPy by incorporating features of the competing Numarray into Numeric, with extensive modifications. NumPy is open-source software and has many contributors. NumPy is a NumFOCUS fiscally sponsored project.

<span class="mw-page-title-main">C syntax</span> Set of rules defining correctly structured programs

The syntax of the C programming language is the set of rules governing writing of software in C. It is designed to allow for programs that are extremely terse, have a close relationship with the resulting object code, and yet provide relatively high-level data abstraction. C was the first widely successful high-level language for portable operating-system development.

<span class="mw-page-title-main">Pointer (computer programming)</span> Object which stores memory addresses in a computer program

In computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer. As an analogy, a page number in a book's index could be considered a pointer to the corresponding page; dereferencing such a pointer would be done by flipping to the page with the given page number and reading the text found on that page. The actual format and content of a pointer variable is dependent on the underlying computer architecture.

IDL, short for Interactive Data Language, is a programming language used for data analysis. It is popular in particular areas of science, such as astronomy, atmospheric physics and medical imaging. IDL shares a common syntax with PV-Wave and originated from the same codebase, though the languages have subsequently diverged in detail. There are also free or costless implementations, such as GNU Data Language (GDL) and Fawlty Language (FL).

Coarray Fortran (CAF), formerly known as F--, started as an extension of Fortran 95/2003 for parallel processing created by Robert Numrich and John Reid in the 1990s. The Fortran 2008 standard now includes coarrays, as decided at the May 2005 meeting of the ISO Fortran Committee; the syntax in the Fortran 2008 standard is slightly different from the original CAF proposal.

In computer programming, a return statement causes execution to leave the current subroutine and resume at the point in the code immediately after the instruction which called the subroutine, known as its return address. The return address is saved by the calling routine, today usually on the process's call stack or in a register. Return statements in many programming languages allow a function to specify a return value to be passed back to the code that called the function.

The computer programming languages C and Pascal have similar times of origin, influences, and purposes. Both were used to design their own compilers early in their lifetimes. The original Pascal definition appeared in 1969 and a first compiler in 1970. The first version of C appeared in 1972.

In a programming language, an evaluation strategy is a set of rules for evaluating expressions. The term is often used to refer to the more specific notion of a parameter-passing strategy that defines the kind of value that is passed to the function for each parameter and whether to evaluate the parameters of a function call, and if so in what order. The notion of reduction strategy is distinct, although some authors conflate the two terms and the definition of each term is not widely agreed upon.

This is an overview of Fortran 95 language features. Included are the additional features of TR-15581:Enhanced Data Type Facilities, which have been universally implemented. Old features that have been superseded by new ones are not described – few of those historic features are used in modern programs although most have been retained in the language to maintain backward compatibility. The current standard is Fortran 2023; many of its new features are still being implemented in compilers. The additional features of Fortran 2003, Fortran 2008, Fortran 2018 and Fortran 2023 are described by Metcalf, Reid, Cohen and Bader.

This article compares a large number of programming languages by tabulating their data types, their expression, statement, and declaration syntax, and some common operating-system interfaces.

<span class="mw-page-title-main">Silverfrost FTN95</span>

Silverfrost FTN95: Fortran for Windows is a compiler for the Fortran programming language for computers running Microsoft Windows. It generates executable programs from human-written source code for native IA-32 Win32, x86-64 and for Microsoft's .NET platform. There is a free-of-charge Personal edition, which generates programs which briefly display a banner, and Commercial and Academic editions.

The structure of the Perl programming language encompasses both the syntactical rules of the language and the general ways in which programs are organized. Perl's design philosophy is expressed in the commonly cited motto "there's more than one way to do it". As a multi-paradigm, dynamically typed language, Perl allows a great degree of flexibility in program design. Perl also encourages modularization; this has been attributed to the component-based design structure of its Unix roots, and is responsible for the size of the CPAN archive, a community-maintained repository of more than 100,000 modules.

In computer programming, a function, subprogram, procedure, method, routine or subroutine is a callable unit that has a well-defined behavior and can be invoked by other software units to exhibit that behavior.

This glossary of computer science is a list of definitions of terms and concepts used in computer science, its sub-disciplines, and related fields, including terms relevant to software, data science, and computer programming.