Misplaced Pages

SuperPascal

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

SuperPascal is an imperative, concurrent computing programming language developed by Per Brinch Hansen . It was designed as a publication language : a thinking tool to enable the clear and concise expression of concepts in parallel programming. This is in contrast with implementation languages which are often complicated with machine details and historical conventions. It was created to address the need at the time for a parallel publication language. Arguably, few languages today are expressive and concise enough to be used as thinking tools.

#162837

36-414: SuperPascal is based on Niklaus Wirth 's sequential language Pascal , extending it with features for safe and efficient concurrency. Pascal itself was used heavily as a publication language in the 1970s. It was used to teach structured programming practices and featured in text books, for example, on compilers and programming languages. Hansen had earlier developed the language Concurrent Pascal , one of

72-406: A parallel statement a target variable cannot be updated by more than a single process, but an expression variable (which can't be updated) may be used by multiple processes. In some circumstances, when a variable such as an array is the target of multiple parallel processes, and the programmer knows its element-wise usage is disjoint , then the disjointness restriction may be overridden with

108-437: A pipeline of processes can be recursively defined using a parallel statement. Another example is the recursive definition of a process tree : The most difficult aspect of concurrent programming is unpredictable or non-reproducible behaviour caused by time-dependent errors. Time-dependent errors are caused by interference between parallel processes, due to variable updates or channel conflicts. If processes sharing

144-526: A Master of Science (M.Sc.) from Université Laval in Quebec . Then in 1963, he was awarded a PhD in electrical engineering and computer science (EECS) from the University of California, Berkeley , supervised by computer design pioneer Harry Huskey . From 1963 to 1967, Wirth served as assistant professor of computer science at Stanford University and again at the University of Zürich . Then in 1968, he became

180-448: A block consisting of " A sequence of declarations followed by a sequence of statements and enclosed between begin and end..." in which "[e]very declaration appears in a block in this way and is valid only for that block." Blocks use different syntax in different languages. Two broad families are: Some languages which support blocks with declarations do not fully support all declarations; for instance many C-derived languages do not permit

216-411: A function definition within a block ( nested functions ). And unlike its ancestor Algol, Pascal does not support the use of blocks with their own declarations inside the begin and end of an existing block, only compound statements enabling sequences of statements to be grouped together in if , while , repeat and other control statements. The semantic meaning of a block is twofold. Firstly, it provides

252-477: A preceding [sic] statement. SuperPascal is a block structured language, with the same basic syntax as Pascal. A program consists of a header , global variable definitions , function or procedure definitions and a main procedure. Functions and procedures consists of blocks , where a block is a set of statements . Statements are separated by semicolons, as opposed to languages like C or Java , where they are terminated by semicolons. The following

288-558: A professor of informatics at ETH Zürich, taking two one-year sabbaticals at Xerox PARC in California (1976–1977 and 1984–1985). He retired in 1999. Although Wirth was involved with developing international standards in programming and informatics, as a member of the International Federation for Information Processing (IFIP) Working Group 2.1 on Algorithmic Languages and Calculi, which specified , maintains, and supports

324-412: A programming guide. Wirth died on New Year's Day 2024, at age 89. Block (programming) In computer programming , a block or code block or block of code is a lexical structure of source code which is grouped together. Blocks consist of one or more declarations and statements . A programming language that permits the creation of blocks, including blocks nested within other blocks,

360-513: A subset of occam 2, with the added generality of dynamic process arrays and recursive parallel processes. A parallel statement denotes that the fixed number of statements it contains must be executed in parallel. For example: A forall statement denotes the parallel execution of a statement by a dynamic number of processes, for example: Parallel processes communicate by sending typed messages through channels created dynamically. Channels are not variables in themselves, but are identified by

396-433: A unique value known as the channel reference , which are held by channel variables . A channel is declared, for example, by the declaration which defines a new (mixed) type named channel and a variable of this type named c . A mixed type channel is restricted to transmitting only the specified types, in this case boolean and integer values. The channel c is initialised by the open statement: Message communication

SECTION 10

#1733094225163

432-486: A variable, update it at unpredictable times, the resulting behaviour of the program is time-dependent. Similarly, if two processes simultaneously try to send or receive on a shared channel, the resulting effect is time-dependent. SuperPascal enforces certain restrictions on the use of variables and communication to minimise or eliminate time-dependent errors. With variables, a simple rule is required: parallel processes can only update disjoint sets of variables. For example, in

468-577: Is an example of a complete SuperPascal program, which constructs a pipeline communication structure with 100 nodes. A master node sends an integer token to the first node, this is then passed along the pipeline and incremented at each step, and finally received by the master node and printed out. The SuperPascal software can be accessed freely from the Brinch Hansen Archive. It consists of a compiler and interpreter, which are both written in normal, sequential Pascal (ISO Level 1 standard Pascal). This

504-505: Is called a block-structured programming language . Blocks are fundamental to structured programming , where control structures are formed from blocks. Blocks have two functions: to group statements so that they can be treated as one statement, and to define scopes for names to distinguish them from the same name used elsewhere. In a block-structured programming language, the objects named in outer blocks are visible inside inner blocks, unless they are masked by an object declared with

540-572: Is supported by the GNU Pascal compiler and newer versions of the Free Pascal compiler (2.7.1+) with the -Miso switch, with the following respective small modifications to the code. For GPC, the file interpret.p uses the non-standard clock function (line 1786), which is used to obtain the system time. Instead, the Extended Pascal getTimeStamp function can be used (which is supported by

576-721: Is then achieved with the send(channel, value) and receive(channel, variable) statements. The expression or variable providing the value for send , and the variable in receive , must both be of the same type as the first channel argument. The following example shows the use of these functions in a process that receives a value from the left channel and outputs it on the right one. The functions send and receive can both take multiple input and output arguments respectively: The following runtime communication errors can occur: Recursive procedures can be combined with parallel and forall statements to create parallel recursive processes. The following example shows how

612-665: The Lola (1995) digital hardware design and simulation system. In 1984, Wirth received the Association for Computing Machinery (ACM) Turing Award for the development of these languages. In 1994, he was inducted as a Fellow of the ACM. In 1999, he received the ACM SIGSOFT Outstanding Research Award In 1995, he popularized the adage now named Wirth's law . In his 1995 paper "A Plea for Lean Software" he attributed

648-580: The Turing Award , generally recognized as the highest distinction in computer science , "for developing a sequence of innovative computer languages". Niklaus Emil Wirth was born in Winterthur , Switzerland, on 15 February 1934. He earned a Bachelor of Science (B.S.) degree in electronic engineering from the Swiss Federal Institute of Technology, Zürich (ETH Zürich) in 1959. In 1960, he earned

684-466: The programming languages ALGOL 60 and ALGOL 68 , he got frustrated by the discussions in the standards groups and published his languages later on as personal work, mainly Pascal , Modula-2 and Oberon . In 2004, he was made a Fellow of the Computer History Museum "for seminal work in programming languages and algorithms, including Euler, Algol-W, Pascal, Modula, and Oberon." Wirth

720-400: The 1973 edition, stated the book "... is tailored to the needs of people who view a course on systematic construction of algorithms as part of their basic mathematical training, rather than to the immediate needs of those who wish to be able to occasionally encode a problem and hand it over to their computer for instant solution." Described in the review as a challenging text to work through, it

756-506: The GNU Pascal compiler), by declaring a variable of type TimeStamp , setting that with the current time using getTimeStamp and assigning the Second field of the TimeStamp to the variable t . Free Pascal also needs a solution to the above "clock" problem (On windows, just declare gettickcount as external with "clock" as name). Further, the reset/rewrites that are marked as non-standard in

SECTION 20

#1733094225163

792-458: The earliest concurrent languages for the design of operating systems and real-time control systems. The requirements of SuperPascal were based on the experience gained by Hansen over three years in developing a set of model parallel programs, which implemented methods for common problems in computer science . This experimentation allowed him to make the following conclusions about the future of scientific parallel computing : These then led to

828-419: The following requirements for a parallel publication language: The key ideas in the design of SuperPascal was to provide a secure programming, with abstract concepts for parallelism. SuperPascal is secure in that it should enable its compiler and runtime system to detect as many cases as possible in which the language concepts break down and produce meaningless results. SuperPascal imposes restrictions on

864-496: The following to Martin Reiser phrasing it as, "Software is getting slower more rapidly than hardware becomes faster." The April 1971 Communications of the ACM article "Program Development by Stepwise Refinement", concerning the teaching of programming, is considered to be a classic text in software engineering. The paper is considered to be the earliest work to formally outline the top-down method for designing programs. The article

900-549: The new title Algorithms & Data Structures were published in 1986 and 2004. The examples in the first edition were written in Pascal. These were replaced in the later editions with examples written in Modula-2 and Oberon, respectively. In 1992, Wirth and Jürg Gutknecht published the full documentation of the Oberon operating system. A second book, with Martin Reiser, was intended as

936-444: The program is not reflected in the language, and analyzing when a given statement is executed can be difficult. Blocks allow the programmer to treat a group of statements as a unit, and the default values which had to appear in initialization in this style of programming can, with a block structure, be placed closer to the decision: Use of blocks in the above fragment of Pascal clarifies the programmer's intent, and enables combining

972-466: The programmer with a way for creating arbitrarily large and complex structures that can be treated as units. Secondly, it enables the programmer to limit the scope of variables and sometimes other objects that have been declared. In early languages such as Fortran IV and BASIC , there were no statement blocks or control structures other than simple forms of loops. Conditionals were implemented using conditional goto statements: The logical structure of

1008-437: The resulting blocks into a nested hierarchy of conditional statements. The structure of the code reflects the programmer's thinking more closely, making it easier to understand and modify. The above source code can be made even clearer by taking the inner if statement out of the outer one altogether, placing the two blocks one after the other to be executed consecutively. Semantically there is little difference in this case, and

1044-474: The same name. Ideas of block structure were developed in the 1950s during the development of the first autocodes , and were formalized in the Algol 58 and Algol 60 reports. Algol 58 introduced the notion of the "compound statement", which was related solely to control flow . The subsequent Revised Report which described the syntax and semantics of Algol 60 introduced the notion of a block and block scope , with

1080-413: The same variable, IEMPNO, for a different purpose, and this could result in a bug that was difficult to trace. Block structure makes it easier for programmers to control scope to a minute level. In the above Scheme fragment, empno is used to identify both the manager and their underlings each by their respective ssn, but because the underling ssn is declared within an inner block it does not interact with

1116-505: The source code must be changed to assign/reset (or rewrite) pairs. (GPC probably only errors on this if you enable strict flags), and the C preprocessor commands #include 'xx' must be changed to {$ include 'xx'}. Niklaus Wirth Niklaus Emil Wirth ( IPA : / v ɛr t / ) (15 February 1934 – 1 January 2024) was a Swiss computer scientist . He designed several programming languages , including Pascal , and pioneered several classic topics in software engineering. In 1984, he won

SuperPascal - Misplaced Pages Continue

1152-413: The use of block structure, supported by indenting for readability, makes it easy for the programmer to refactor the code. In primitive languages, variables had broad scope. For instance, an integer variable called IEMPNO might be used in one part of a Fortran subroutine to denote an employee social security number (ssn), but during maintenance work on the same subroutine, a programmer might accidentally use

1188-404: The use of variables that enable a single-pass compiler to check that parallel processes are disjoint, even if the processes use procedures with global variables, eliminating time-dependent errors. Several features in Pascal were ambiguous or insecure and were omitted from SuperPascal, such as labels and goto statements, pointers and forward declarations. The parallel features of SuperPascal are

1224-404: Was discussed by Fred Brooks in his influential book The Mythical Man-Month and was described as "seminal" in the ACM's brief biography of Wirth published in connection to his Turing Award. The 1973 textbook, Systematic Programming: An Introduction , was described as a quality source for mathematicians desiring to understand the nature of programming in a 1974 review. The cover flap, of

1260-523: Was nevertheless recommended as useful reading for those interested in numerical mathematics. In 1974, The Pascal User Manual and Report , jointly written with Kathleen Jensen , served as the basis of many language implementation efforts in the 1970s ( BSD Pascal ), and 1980s in the United States and across Europe. In 1975, he wrote the book Algorithms + Data Structures = Programs , which gained wide recognition. Major revisions of this book with

1296-508: Was the chief designer of the programming languages Euler (1965), PL360 (1966), ALGOL W (1966), Pascal (1970), Modula (1975), Modula-2 (1978), Oberon (1987), Oberon-2 (1991), and Oberon-07 (2007). He was also a major part of the design and implementation team for the operating systems Medos-2 (1983, for the Lilith workstation ), and Oberon (1987, for the Ceres workstation), and for

#162837