HOME

TheInfoList



OR:

S-algol (St Andrews Algol) is a computer
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
derivative of
ALGOL 60 ALGOL 60 (short for ''Algorithmic Language 1960'') is a member of the ALGOL family of computer programming languages. It followed on from ALGOL 58 which had introduced code blocks and the begin and end pairs for delimiting them, representing a k ...
developed at the
University of St Andrews (Aien aristeuein) , motto_lang = grc , mottoeng = Ever to ExcelorEver to be the Best , established = , type = Public research university Ancient university , endowment ...
in 1979 by
Ron Morrison Ron Morrison was the head of School of the computer science department of the University of St. Andrews where he worked on programming languages, inventing S-algol, and coinventing PS-algol and Napier88. He had graduated from St. Andrews wit ...
and Tony Davie. The language is a modification of ALGOL to contain orthogonal
data type In computer science and computer programming, a data type (or simply type) is a set of possible values and a set of allowed operations on it. A data type tells the compiler or interpreter how the programmer intends to use the data. Most progra ...
s that Morrison created for his PhD thesis. Morrison would go on to become
professor Professor (commonly abbreviated as Prof.) is an Academy, academic rank at university, universities and other post-secondary education and research institutions in most countries. Literally, ''professor'' derives from Latin as a "person who pr ...
at the university and head of the department of
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
. The S-algol language was used for teaching at the university at an
undergraduate Undergraduate education is education conducted after secondary education and before postgraduate education. It typically includes all postsecondary programs up to the level of a bachelor's degree. For example, in the United States, an entry-lev ...
level until 1999. It was also the language taught for several years in the 1980s at a local school in St. Andrews,
Madras College Madras College, often referred to as Madras, is a Scottish comprehensive secondary school located in St Andrews, Fife. It educates over 1,400 pupils aged between 11 and 18 and was founded in 1833 by the Rev. Dr Andrew Bell. History Madras ...
. The computer science text ''Recursive Descent Compiling'' describes a
recursive descent In computer science, a recursive descent parser is a kind of top-down parsing, top-down parser built from a set of mutual recursion, mutually recursive procedures (or a non-recursive equivalent) where each such procedure (computer science), proce ...
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
for S-algol, implemented in S-algol.
PS-algol PS-algol is an orthogonally persistent programming language. PS-algol was an extension of the language S-algol implemented by the University of St Andrews and the University of Edinburgh, Scotland. S-algol was designed by Ron Morrison and extend ...
is a
persistent Persistent may refer to: * Persistent data * Persistent data structure * Persistent identifier * Persistent memory * Persistent organic pollutant * Persistent Systems, a technology company * USS ''Persistent'', three United States Navy ships See ...
derivative of S-algol. It was developed around 1981 at the
University of Edinburgh The University of Edinburgh ( sco, University o Edinburgh, gd, Oilthigh Dhùn Èideann; abbreviated as ''Edin.'' in post-nominals) is a public research university based in Edinburgh, Scotland. Granted a royal charter by King James VI in 15 ...
and of St Andrews. It supports
database In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases sp ...
ability by providing for longevity of data in the form of a persistent heap that survives termination of PS-algol programs.


History and implementations

Ron Morrison's 1979 PhD thesis, ''On the Development of Algol'', describes the design and implementation of the S-algol language. The technical report defining the language, ''The S-algol Reference Manual'' (1979, 1988), thanks several people for their help, including David Turner for discussions on language design around 1975. The 1981 computer science text ''Recursive Descent Compiling'' describes the compiler implementation and bootstrapping process, and the 1982 book ''An Introduction to Programming with S-algol'' uses the language to teach computer programming. The first S-algol implementation was on a
PDP-11 The PDP-11 is a series of 16-bit minicomputers sold by Digital Equipment Corporation (DEC) from 1970 into the 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of all models were sold, ...
/40 computer running the
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
operating system. Due to the small 64
kilobyte The kilobyte is a multiple of the unit byte for digital information. The International System of Units (SI) defines the prefix ''kilo'' as 1000 (103); per this definition, one kilobyte is 1000 bytes.International Standard IEC 80000-13 Quantiti ...
address space In computing, an address space defines a range of discrete addresses, each of which may correspond to a network host, peripheral device, disk sector, a memory cell or other logical or physical entity. For software programs to save and retrieve st ...
available on the PDP-11, an interpreted
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
implementation was chosen. A single-pass, recursive descent compiler written in S-algol translated S-algol source into S-code, a bytecode for a stack-based abstract machine tailored for S-algol. The S-code was then executed by an interpreter. The S-algol implementation had many similarities with work on earlier
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, Fren ...
compilers. The technique of using a recursive descent compiler to produce code for an abstract machine was well known, with the Pascal P compiler being a famous example from the early 1970s. The S-algol compiler was written using the stepwise refinement process described by Urs Amman for the development of a Pascal compiler and championed by the inventor of Pascal,
Niklaus Wirth Niklaus Emil Wirth (born 15 February 1934) is a Swiss computer scientist. He has designed several programming languages, including Pascal (programming language), Pascal, and pioneered several classic topics in software engineering. In 1984, he w ...
. Reflecting the memory organization of the PDP-11 as 32K 16-bit
word A word is a basic element of language that carries an semantics, objective or pragmatics, practical semantics, meaning, can be used on its own, and is uninterruptible. Despite the fact that language speakers often have an intuitive grasp of w ...
s, the S-code instruction encoding was designed so that each bytecode consisted of one word. The initial bootstrap was performed by writing an S-algol compiler in
Algol W ALGOL W is a programming language. It is based on a proposal for ALGOL X by Niklaus Wirth and Tony Hoare as a successor to ALGOL 60. ALGOL W is a relatively simple upgrade of the original ALGOL 60, adding string, bitstring, complex number and r ...
on the
IBM/360 The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applica ...
that produced S-code, and using it to compile the compiler written in S-algol to S-code. The resulting S-code file was copied to the PDP-11 and executed on an S-code interpreter written for the PDP-11, making it self-hosting. The self-hosted S-algol compiler executed approximately 7.7 million S-code instructions to compile itself, generating an output file of about ten thousand S-code instructions (16-bit words). An S-code interpreter was written for the
VAX VAX (an acronym for Virtual Address eXtension) is a series of computers featuring a 32-bit instruction set architecture (ISA) and virtual memory that was developed and sold by Digital Equipment Corporation (DEC) in the late 20th century. The V ...
computer running
VMS #REDIRECT VMS {{redirect category shell, {{R from other capitalisation{{R from ambiguous page ...
, making the VAX the first S-algol
port A port is a maritime facility comprising one or more wharves or loading areas, where ships load and discharge cargo and passengers. Although usually situated on a sea coast or estuary, ports can also be found far inland, such as Ham ...
. S-algol was also ported to the
Zilog Z80 The Z80 is an 8-bit microprocessor introduced by Zilog as the startup company's first product. The Z80 was conceived by Federico Faggin in late 1974 and developed by him and his 11 employees starting in early 1975. The first working samples wer ...
microprocessor running
CP/M CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system created in 1974 for Intel 8080/ 85-based microcomputers by Gary Kildall of Digital Research, Inc. Initial ...
, including
raster graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
facilities that had been added to the language. In 1983, S-algol was used as the basis for the PS-algol system, used for research in persistence. The PS-algol S-code interpreter was implemented in C, and the S-code language was extended to include raster graphics. The PS-algol implementation was the basis for S-algol ports to the
Macintosh The Mac (known as Macintosh until 1999) is a family of personal computers designed and marketed by Apple Inc., Apple Inc. Macs are known for their ease of use and minimalist designs, and are popular among students, creative professionals, and ...
and
Sun workstations The Sun is the star at the center of the Solar System. It is a nearly perfect ball of hot plasma, heated to incandescence by nuclear fusion reactions in its core. The Sun radiates this energy mainly as light, ultraviolet, and infrared radia ...
, featuring a compiler rewritten in C and targeting the extended S-code. S-algol was the basis for the PS-algol research in 1983, and a few years later PS-algol became the starting point for the
Napier88 Napier88 is an orthogonally persistent programming language that was designed and implemented at the University of St Andrews, Scotland. The primary designer was Ron Morrison, whose initial designs were extended and implemented by Fred Brown, Ric ...
language and implementation. While all S-algol compilers produced S-code to be interpreted, a later Napier88 implementation experimented with generating code in C and compiling it with the
gcc compiler The GNU Compiler Collection (GCC) is an optimizing compiler produced by the GNU Project supporting various programming languages, hardware architectures and operating systems. The Free Software Foundation (FSF) distributes GCC as free software ...
to provide a
native code In computer programming, machine code is any low-level programming language, consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). Each instruction causes the CPU to perform a very ...
implementation.


Language overview

An S-algol program is a sequence of declarations and clauses. Language elements that are declared include constants, variables, procedures and structures. Constant and variable declarations must specify an initial value. The compiler infers the data type of the declared constant or variable from the type of the initial value, so the type is not stated explicitly. Data types include integer, real, boolean, string, pointer (to a structure), and file, and vectors (arrays) of these types. Procedure declarations do specify the data types of their arguments and return value (unless void). Structures also specify the data types of their fields. Clauses include expressions and control structures (if, case, for, while and repeat while). The if and case control structures can have values and can be used freely in expressions as long as the type compatibility rules are met. ! Comments are introduced by an exclamation point and continue until end of line. ! The let keyword introduces declarations of constants and variables ! Identifiers start with an alphabetic character followed by alphanumeric characters or the full stop (.) ! An initial value must be given, and this determines the data type of declaration let width := 10 ! := sets the value of a variable, this is an int let animal := "dog" ! type string let x := -7 ; let y := x + x ! ; separates clauses, needed only if there are two or more clauses on a line let n.a = 6.022e+23 ! = is used to set the value of a constant, this is a cfloat (constant float) ! if and case can have values and be used in expressions let no.of.lives := if animal = "cat" then 9 else 1 ! Sieve of Eratosthenes write "Find primes up to n = ?" let n = readi ! constant values can be set during the program run let p = vector 2::n of true ! vector of bool with bounds 2 to n for i = 2 to truncate(sqrt(n)) do ! for indexes are constants so they use = rather than := if p(i) do ! vector dereference uses parens like a procedure call for j = 2 * i to n by i do p(j) := false for i = 2 to n do if p(i) do write i, "'n" ! 'n in a literal string is a newline ! structure (record) type for a binary tree of cstrings ! the pntr data type can point to a structure of any type, type checking is done at runtime structure tree.node(cstring name ; pntr left, right) ! inserts a new string into the binary tree head procedure insert.tree(cpntr head ; cstring new -> pntr) ! the case clause ends with a mandatory default option, use default : if it is not needed case true of head = nil : tree.node(new, nil, nil) new < head(name) : new > head(name) : default : head procedure print.tree(cpntr head) if head ~= nil do ! ~= is the not equals operator begin print.tree(head(left)) write head(name), "'n" print.tree(head(right)) end let fruit := nil fruit := insert.tree(fruit, "banana") fruit := insert.tree(fruit, "kiwi") fruit := insert.tree(fruit, "apple") fruit := insert.tree(fruit, "peach") print.tree(fruit) ! print in sorted order ! The end of the S-algol program is indicated by ? ?


Semantic principles

As its name suggests, S-algol is a member of the
ALGOL ALGOL (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the ...
family of programming languages. Morrison identifies five traits of the ALGOL family: # ''Scope rules and block structure'' – Names can be introduced to define local quantities that are undefined outside the local environment, but different environments may use the same name unambiguously to represent different objects. # ''Abstraction facility'' – Provision of a powerful abstraction facility to shorten and clarify programs. In the ALGOL family this is offered by
procedures Procedure may refer to: * Medical procedure * Instructions or recipes, a set of commands that show how to achieve some result, such as to prepare or make something * Procedure (business), specifying parts of a business process * Standard opera ...
with
parameter A parameter (), generally, is any characteristic that can help in defining or classifying a particular system (meaning an event, project, object, situation, etc.). That is, a parameter is an element of a system that is useful, or critical, when ...
s. # ''Compile-time type checking'' –
Types Type may refer to: Science and technology Computing * Typing, producing text via a keyboard, typewriter, etc. * Data type, collection of values used for computations. * File type * TYPE (DOS command), a command to display contents of a file. * Typ ...
can be checked by a
static analysis Static analysis, static projection, or static scoring is a simplified analysis wherein the effect of an immediate change to a system is calculated without regard to the longer-term response of the system to that change. If the short-term effect i ...
of the program. # ''Infinite store'' – The programmer is not responsible for storage allocation and can create as many data objects as needed. # ''Selective store updating'' – The program may selectively alter the store. In the ALGOL family this is effected by the
assignment statement In computer programming, an assignment statement sets and/or re-sets the value stored in the storage location(s) denoted by a variable name; in other words, it copies a value into the variable. In most imperative programming languages, the assi ...
. S-algol was designed to differ from prior members of the ALGOL family by being designed according to semantic principles to provide power through simplicity, and simplicity through greater generality. (See
Orthogonal In mathematics, orthogonality is the generalization of the geometric notion of ''perpendicularity''. By extension, orthogonality is also used to refer to the separation of specific features of a system. The term also has specialized meanings in ...
.) Morrison describes three semantic principles that guided the design of S-algol: # ''Principle of correspondence'' – The rules governing names should be uniform and apply everywhere. This mostly applies to correspondence between declarations and procedure parameters, including consideration of all parameter passing modes. This principle was examined by R. D. Tennent in conjunction with Pascal, and has its roots in work by
Peter Landin Peter John Landin (5 June 1930 – 3 June 2009) was a British computer scientist. He was one of the first to realise that the lambda calculus could be used to model a programming language, an insight that is essential to the development of both ...
and
Christopher Strachey Christopher S. Strachey (; 16 November 1916 – 18 May 1975) was a British computer scientist. He was one of the founders of denotational semantics, and a pioneer in programming language design and computer time-sharing.F. J. Corbató, et al., ...
. # ''Principle of abstraction'' – It should be possible to abstract over all meaningful semantic categories in the language. Examples include the function, which is an abstraction over
expression Expression may refer to: Linguistics * Expression (linguistics), a word, phrase, or sentence * Fixed expression, a form of words with a specific meaning * Idiom, a type of fixed expression * Metaphorical expression, a particular word, phrase, o ...
s, and the procedure, an abstraction over statements. Tennent and Morrison note that this is a difficult principle to apply because it is hard to identify the semantically meaningful constructs that should be abstracted. # ''Principle of data type completeness'' – All data types should have the same rights in the language, and should be allowed in general operations such as assignment or being passed as a parameter. (See
first-class citizen In programming language design, a first-class citizen (also type, object, entity, or value) in a given programming language is an entity which supports all the operations generally available to other entities. These operations typically include b ...
.) Morrison also identifies one more basic design consideration: # ''Conceptual store'' – The key design decisions concerning the store (
memory management Memory management is a form of resource management applied to computer memory. The essential requirement of memory management is to provide ways to dynamically allocate portions of memory to programs at their request, and free it for reuse when ...
) include how the store is used, its relationship to data types, implementation of pointers, and protection ( constant locations that can't be updated).


Design

Morrison's thesis explains how the design principles were applied in S-algol.


Data types

The basic or
primitive data type In computer science, primitive data types are a set of basic data types from which all other data types are constructed. Specifically it often refers to the limited set of data representations in use by a particular processor, which all compiled pr ...
s in S-algol are integer, real, boolean, file, and string. (Later
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device. In most digital display devices, pixels are the smal ...
and picture types were added to support
raster graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
.)
Integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign (−1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the language ...
,
real Real may refer to: Currencies * Brazilian real (R$) * Central American Republic real * Mexican real * Portuguese real * Spanish real * Spanish colonial real Music Albums * ''Real'' (L'Arc-en-Ciel album) (2000) * ''Real'' (Bright album) (2010) ...
, and boolean are types common to most programming languages. The file type is an
input/output In computing, input/output (I/O, or informally io or IO) is the communication between an information processing system, such as a computer, and the outside world, possibly a human or another information processing system. Inputs are the signals ...
(I/O)
stream A stream is a continuous body of water, body of surface water Current (stream), flowing within the stream bed, bed and bank (geography), banks of a channel (geography), channel. Depending on its location or certain characteristics, a stream ...
that allows writing or reading data objects. The string type in many languages at that time was considered a compound type, but including it as a native type makes the basic operations of concatenation, substring selection, length, and the comparisons (equals, less than, etc.) easier to use. It is much more pleasant than the arrays of characters used in Pascal. Vectors are provided with components of any type. For any data type T, *T is the type of a vector with components of type T. The bounds of the vector are not part of its type but are determined dynamically, and multi-dimension arrays are implemented as vectors of vectors. The structure data type comprises any fixed number of fields each of a fixed type. The class of a structure is not part of the type but can be determined dynamically. The closure of basic types over vectors and structures provides an infinite number of data types. The language definition allows any type to be used anywhere a type is acceptable. This does not apply to infix operators, as they are syntactic sugar for common functions and are not part of the semantic model.


The store

Vectors and structures have full rights and can be assigned as passed as parameters, but copy on assignment and when passed can be inefficient for large objects. Vectors and structures are treated as pointers to the objects, and the pointers are assigned and passed as parameters.
Pointers Pointer may refer to: Places * Pointer, Kentucky * Pointers, New Jersey * Pointers Airport, Wasco County, Oregon, United States * The Pointers, a pair of rocks off Antarctica People with the name * Pointer (surname), a surname (including a l ...
as general objects themselves as in
ALGOL 68 ALGOL 68 (short for ''Algorithmic Language 1968'') is an imperative programming language that was conceived as a successor to the ALGOL 60 programming language, designed with the goal of a much wider scope of application and more rigorously de ...
and C are rejected for S-algol because of the concerns of C.A.R. Hoare about the
null pointer In computing, a null pointer or null reference is a value saved for indicating that the pointer or reference does not refer to a valid object. Programs routinely use null pointers to represent conditions such as the end of a list of unknown lengt ...
and the problems with
dangling pointer Dangling pointers and wild pointers in computer programming are pointers that do not point to a valid object of the appropriate type. These are special cases of memory safety violations. More generally, dangling references and wild references are ...
s. S-algol provides true constant values, objects which value cannot be updated. This idea is due to Strachey, but constants in many languages such as Pascal are manifest constants, processed at compile time and not implemented as protected locations. Also it must be possible to declare a constant of any data type, not just the scalar types.


Control structures

S-algol is an expression-oriented language, and statements are
expression Expression may refer to: Linguistics * Expression (linguistics), a word, phrase, or sentence * Fixed expression, a form of words with a specific meaning * Idiom, a type of fixed expression * Metaphorical expression, a particular word, phrase, o ...
s of type
void Void may refer to: Science, engineering, and technology * Void (astronomy), the spaces between galaxy filaments that contain no galaxies * Void (composites), a pore that remains unoccupied in a composite material * Void, synonym for vacuum, a ...
. As a consequence, some
control structure In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an ''imp ...
s are expressions that yield
value Value or values may refer to: Ethics and social * Value (ethics) wherein said concept may be construed as treating actions themselves as abstract objects, associating value to them ** Values (Western philosophy) expands the notion of value beyo ...
s. There are several
conditional constructs Conditional (if then) may refer to: *Causal conditional, if X then Y, where X is a cause of Y *Conditional probability, the probability of an event A given that another event B has occurred *Conditional proof, in logic: a proof that asserts a co ...
. The two-alternative version of the conditional is if then else , where the clauses can be statements or expressions. If they are expressions, they must have the same type. The one-armed conditional if do has type void. Use of do instead of else in the conditional statement avoids the
dangling else The dangling else is a problem in programming of parser generators in which an optional else clause in an if–then(–else) statement results in nested conditionals being ambiguous. Formally, the reference context-free grammar of the language i ...
syntactic ambiguity. The case clause has a selector of any type which is matched using an equality test against expressions of the same type to find the selected clause. The case clause can be a statement or an expression, so the result clauses must all be statements (type void) or expressions of the same type. Matches are tested in order, so this resembles the
guarded commands The Guarded Command Language (GCL) is a programming language defined by Edsger Dijkstra for predicate transformer semantics in EWD472. It combines programming concepts in a compact way. It makes it easier to develop a program and its proof hand-in-h ...
of
Edsger Dijkstra Edsger Wybe Dijkstra ( ; ; 11 May 1930 – 6 August 2002) was a Dutch computer scientist, programmer, software engineer, systems scientist, and science essayist. He received the 1972 Turing Award for fundamental contributions to developing progra ...
without the non-determinism. The loop statements are mostly conventional. The for loop is similar to that of Hoare. The control identifier is constant and cannot be modified inside the loop. Also conventional are the while do and repeat while loops. The repeat while do construct provides the early exit or "n-and-a-half"
Edsger Dijkstra Edsger Wybe Dijkstra ( ; ; 11 May 1930 – 6 August 2002) was a Dutch computer scientist, programmer, software engineer, systems scientist, and science essayist. He received the 1972 Turing Award for fundamental contributions to developing progra ...
(1973). Personal communication to
Donald Knuth Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist, mathematician, and professor emeritus at Stanford University. He is the 1974 recipient of the ACM Turing Award, informally considered the Nobel Prize of computer sc ...
, cited in
loop.


Abstractions

S-algol abstracts expressions as functions and statements (void expressions) as procedures.
Modules Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
would provide the abstraction of declarations, but S-algol does not include modules because of the difficulties they pose with block-structured scope. The final syntactic category is sequencer, or control structure. Tennent used the term ''sequel'' for the abstraction over sequencers, these would be generalizations of
goto GoTo (goto, GOTO, GO TO or other case combinations, depending on the programming language) is a statement found in many computer programming languages. It performs a one-way transfer of control to another line of code; in contrast a function ca ...
and
break Break or Breaks or The Break may refer to: Time off from duties * Recess (break), time in which a group of people is temporarily dismissed from its duties * Break (work), time off during a shift/recess ** Coffee break, a short mid-morning rest ...
. The best known abstraction in this category is
call-with-current-continuation In the Scheme computer programming language, the procedure call-with-current-continuation, abbreviated call/cc, is used as a control flow operator. It has been adopted by several other programming languages. Taking a function f as its only argum ...
, but it would not be well understood until some years later. S-algol does not include goto or break, and does not include abstraction over sequencers.


Declarations and parameters

Every data object in S-algol must be given a value when it is declared. This corresponds to
call by value 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 f ...
parameter passing and removes the possibility of using an uninitialised value. In fact call by value is the only parameter passing method in S-algol. Reference and result parameters are rejected, which is consistent with the S-algol ban on passing l-values. Structures and vectors are passed as pointers to the objects, but this is still call by value as the behavior is the same as the value used on the right side of assignments. Every declaration has a parametric equivalent. All procedure parameter types must be specified. Any procedure passed as a parameter has its full type specified (in contrast to Pascal) and the same is true for a structure class.


Input output model

S-algol provides the file data type for I/O streams, and several variations of read and write are defined to operate on the basic types. It is expected that individual implementations will extend these simple facilities as needed.


Concrete syntax

ALGOL languages have been criticized as being verbose. S-algol attempts to improve this by providing less restrictive syntax. This is demonstrated mostly in the declaration syntax. Since variable declarations must always include an initial value, the type does not need to be specified explicitly. Although it would be possible to infer procedure parameter and return types by examining where the procedure is called, S-algol does require parameter and return types to be specified. This is a practical decision, since it should be possible to understand a procedure without examining its calls. Most ALGOLs require that all declarations come before the statements in a block. In S-algol, declarations may be mixed with statements because everything must be declared before it is used and there is no goto that would permit jumping past a declaration.


See also

*
Napier88 Napier88 is an orthogonally persistent programming language that was designed and implemented at the University of St Andrews, Scotland. The primary designer was Ron Morrison, whose initial designs were extended and implemented by Fred Brown, Ric ...


References


External links


Algol 60 implementations and dialects
Computer History Museum The Computer History Museum (CHM) is a museum of computer history, located in Mountain View, California. The museum presents stories and artifacts of Silicon Valley and the information age, and explores the computing revolution and its impact on ...
Software Preservation Group
Persistent S-algol
{{Authority control ALGOL 60 dialect