PLANC

Last updated

PLANC
Paradigm Procedural, imperative, structured
Family Pascal
Developer Norsk Data
Final release
Final
Typing discipline Static, strong
Scope Lexical
Platform Norsk Data Nord-10 minicomputers, ND-500 superminicomputer; Motorola 68000, 88000; Intel x86
OS Sintran III
License Proprietary
Influenced by
Nord Programming Language

PLANC (Programming LAnguage for Nd Computers, pronounced as plank) is a high-level programming language.

Contents

Compilers were developed by Norsk Data for several architectures, including the Motorola 68000, 88000, Intel x86, and the Norsk Data Nord-10 minicomputers and ND-500 superminicomputer. [1]

The language was designed to be cross-platform software. It was mainly used internally at Norsk Data for writing high level systems software such as the upper parts of operating systems and compilers.

Basic structure

PLANC programs are structured into modules and routines.

A very simple example of a PLANC program is as follows:

MODULE mod    INTEGER ARRAY : stack (0:100)    PROGRAM : mprog       INTEGER : i, j,k, m       INISTACK stack       1 =: i       2 =: j       i+j =: k =: m    ENDROUTINE ENDMODULE

A difference from popular programming languages is that the assignment operator evaluates from left to right: First it computes the value, and then stores it. Compile-time initialization of variables, in contrast, evaluates from right to left.

The assignment operator returns the stored value, so it can be stored multiple times: 5 =: a =: b would store 5 into both the A and B variables. It shares this direction with Plankalkül, ALGOL 60, Mary (another little known language developed in Norway), and the popular language C.

A related distinct syntactic feature is that a function can be defined to take as input the computed value of the expression on its left side. Also, a single additional argument does not require surrounding parentheses. The resulting infix notation blurs the syntactic difference between functions and operators. Such expressions seem conceptually as having a computed value flowing from left to the right.

Data types

As with all high level languages, PLANC uses variables as can be seen in the prior sample, here are the allowed data types within PLANC:

An enumeration was declared thus:

ENUMERATION (Winter, Spring, Summer, Autumn) : Seasons := Summer

This defines an enumeration of the seasons and sets the default value to Summer.

LABEL is a little different from a normal data type. This is used to predefine a label within code and is used together with a GO statement; very much like GOTO in BASIC.

Access modifiers can be applied to make them READ or WRITE only.

For string data several predefined datatypes are used, they are:

  1. BYTE – Contains one character
  2. BYTES – Contains character strings
  3. BITS – Contains BIT strings

Array pointers were 3-word constructs that included both the base address, the lower bound, and the higher bound of the array; this made it possible to do reliable run-time checking of array boundaries, and made the kind of pointer arithmetic that makes C a more challenging language in which to write.

Some statements

PLANC is a language in the Pascal family. However, it lacks the generic BEGIN END construct often found in Pascal, instead favoring forms like ROUTINE..ENDROUTINE or DO..ENDDO etc.

One feature that sets it apart from some other languages is the construction of loops:

DO .... loop statements... ENDDO

Hopefully one or more of the loop statements would be WHILE condition that allowed breaking out of the loop.

For example:

DO WHILE test ..... ENDDO

Is similar to a C while (test) { ... } loop.

Another example:

DO ..... WHILE test ENDDO

Is similar to a C do { .... } while (test). loop.

Sometimes programmers wrote:

DO WHILE test1 ..... WHILE test2 ENDDO

C would require writing something like while (test1) { .... if (! test2) break; }.

For loops have the following structure:

FOR var IN low:high DO .... loop statements.... ENDDO

A step can also be specified by low:high:step. Alternatively, a type (enumeration or integer ranged type) can be specified to specify a loop over a range of values or a set to loop over all elements of the set or an array can be specified to loop over an array. A pointer:next can be specified, to walk through a list. For example, if defining:

TYPE node = RECORD   node POINTER : next   T            : some_data ENDRECORD

Can be written:

FOR p IN first:next DO ..... ENDFOR

to loop over the list.

A for loop can have WHILE statements inside it. This provides two possible manners of exiting a for loop, either because the list of values are exhausted or because the test failed. Thus, blocks can written to catch each of those:

routinevoid,node pointer (node pointer : list)    for p in first:next dowhile p.val >< 20    exitfor return nilendforreturnendroutine

This returns nil if the list was exhausted but was exited due to while, it just ended up after the loop and returned the pointer to the element found. Alternatively, that could have been placed in an exitwhile block which is identical except it would end up there if and only if the while test failed. If more than one while statement occurs in the loop, it could not tell those apart, they would all make a jump to the same exitwhile block.

PLANC had a primitive exception mechanism: a routine could return an exception, which was a 16-bit integer value. This could then be caught by an ON ROUTINEERROR statement in the calling scope.

See also

Related Research Articles

C (programming language) General-purpose programming language

C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions. It has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computer architectures that range from supercomputers to PLCs and embedded systems.

Pascal (programming language) Programming language

Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named in honour of the French mathematician, philosopher and physicist Blaise Pascal.

Data type

In computer science and computer programming, a data type or simply type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support basic data types of integer numbers, floating-point numbers, characters and Booleans. A data type constrains the values that an expression, such as a variable or a function, might take. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored. A data type provides a set of values from which an expression may take its values.

C syntax Set of rules governing writing of software in the language

The syntax of the C programming language is the set of rules governing writing of software in the C language. 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.

Pointer (computer programming) 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.

For loop control flow statement

In computer science, a for-loop is a control flow statement for specifying iteration, which allows code to be executed repeatedly. Various keywords are used to specify this statement: descendants of ALGOL use "for", while descendants of Fortran use "do". There are other possibilities, for example COBOL which uses "PERFORM VARYING".

This article compares two programming languages: C# with Java. While the focus of this article is mainly the languages and their features, such a comparison will necessarily also consider some features of platforms and libraries. For a more detailed comparison of the platforms, see Comparison of the Java and .NET platforms.

Java syntax

The syntax of Java refers to the set of rules defining how a Java program is written and interpreted.

In computer science, the Boolean data type is a data type that has one of two possible values which is intended to represent the two truth values of logic and Boolean algebra. It is named after George Boole, who first defined an algebraic system of logic in the mid 19th century. The Boolean data type is primarily associated with conditional statements, which allow different actions by changing control flow depending on whether a programmer-specified Boolean condition evaluates to true or false. It is a special case of a more general logical data type —logic doesn't always need to be Boolean.

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.

typedef is a reserved keyword in the programming languages C and C++. It is used to create an additional name (alias) for another data type, but does not create a new type, except in the obscure case of a qualified typedef of an array type where the typedef qualifiers are transferred to the array element type. As such, it is often used to simplify the syntax of declaring complex data structures consisting of struct and union types, but is just as common in providing specific descriptive type names for integer data types of varying lengths.

SystemVerilog hardware description and hardware verification language

SystemVerilog, standardized as IEEE 1800, is a hardware description and hardware verification language used to model, design, simulate, test and implement electronic systems. SystemVerilog is based on Verilog and some extensions, and since 2008 Verilog is now part of the same IEEE standard. It is commonly used in the semiconductor and electronic design industry as an evolution of Verilog.

S-algol is a computer programming language derivative of ALGOL 60 developed at the University of St Andrews in 1979 by Ron Morrison and Tony Davie. The language is a modification of ALGOL to contain orthogonal data types that Morrison created for his PhD thesis. Morrison would go on to become professor at the university and head of the department of computer science. The S-algol language was used for teaching at the university at an undergraduate level until 1999. It was also the language taught for several years in the 1980s at a local school in St. Andrews, Madras College. The computer science text Recursive Descent Compiling describes a recursive descent compiler for S-algol, implemented in S-algol.

In computer programming, an enumerated type is a data type consisting of a set of named values called elements, members, enumeral, or enumerators of the type. The enumerator names are usually identifiers that behave as constants in the language. An enumerated type can be seen as a degenerate tagged union of unit type. A variable that has been declared as having an enumerated type can be assigned any of the enumerators as a value. In other words, an enumerated type has values that are different from each other, and that can be compared and assigned, but are not specified by the programmer as having any particular concrete representation in the computer's memory; compilers and interpreters can represent them arbitrarily.

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 2018; many of its new features are still being implemented in compilers. The additional features of Fortran 2003, Fortran 2008 and Fortran 2018 are described by Metcalf, Reid and Cohen.

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.

In computing, undefined value is a condition where an expression does not have a correct value, although it is syntactically correct. An undefined value must not be confused with empty string, Boolean "false" or other "empty" values. Depending on circumstances, evaluation to an undefined value may lead to exception or undefined behaviour, but in some programming languages undefined values can occur during a normal, predictable course of program execution.

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.

Swift is a general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. and the open-source community. First released in 2014, Swift was developed as a replacement for Apple's earlier programming language Objective-C, as Objective-C had been largely unchanged since the early 1980s and lacked modern language features. Swift works with Apple's Cocoa and Cocoa Touch frameworks, and a key aspect of Swift's design was the ability to interoperate with the huge body of existing Objective-C code developed for Apple products over the previous decades. It is built with the open source LLVM compiler framework and has been included in Xcode since version 6, released in 2014. On Apple platforms, it uses the Objective-C runtime library, which allows C, Objective-C, C++ and Swift code to run within one program.

References

  1. PLANC Reference Manual [ND-60.117.03]. Norsk Data.