S3 (programming language)

Last updated

S3
Paradigm Structured, imperative
Developer International Computers Limited
Influenced by
ALGOL 68

S3 is a structured, imperative high-level computer programming language. [1] It was developed by the UK company International Computers Limited (ICL) for its 2900 Series mainframes. It is a system programming language with syntax influenced by ALGOL 68 but with data types and operators aligned to those offered by the 2900 Series. It was the implementation language of the operating system VME.

Annotated Example

A rare example of an S3 program available in the public domain is the implementation of Kermit developed at the South-West Universities Regional Computer Centre, and archived in the Columbia University archive of Kermit implementations. [2] The examples below are selected highlights of the main module (kmt_main_module).

The program starts with a module identification, and comments which we quote by way of acknowledgment to the authors:

MODULE KMT_MAIN_MODULE;                                         @ Version 1.01 @  @------------------------------------------------------------------------------@ @                                                                              @ @                                                                              @ @               -----  S W U R C C   V M E   K E R M I T  -----                @ @                                                                              @ @                                                                              @ @       ----------------------------------------------------------------       @ @                                                                              @ @                                                                              @ @       Version 1.00   (February 1986)                                         @ @                                                                              @ @         Written by : Richard Andrews and David Lord,                         @ @                      South West Universities Regional Computer Centre,       @ @                      Claverton Down, Bath BA2 7AY, U.K.                      @ @                                                                              @ @                                                                              @ @       ----------------------------------------------------------------       @ @                                                                              @ @                                                                              @ @       Version 1.01   (October 1986)                                          @ @                                                                              @ @           Fixes by : Dave Allum and David Lord, SWURCC.                      @ @       ----------------------------------------------------------------       @

Next follow a number of "mode declarations". Mode is the Algol 68 term for a type.

 MODE KMT_BUFFER IS (96)BYTE;  MODE KMT_STRING IS REF()BYTE;  MODE KMT_WORD IS REF()BYTE;     MODE KMT_MTM_VALUES IS ANY    (LONG WORD      LW_VALUE,     LONG INT       LI_VALUE,     REF WORD       RW_VALUE,     REF INT        RI_VALUE,     REF LONG WORD  RLW_VALUE,     REF LONG INT   RLI_VALUE,     REF()BYTE      RVB_VALUE,     REF()REF()BYTE RVRVB_VALUE);     MODE KMT_PP_PACKET_STATISTICS_S IS STRUCT     (INT INPUT_TOTAL,          OUTPUT_TOTAL); 

The first type is an array of 96 bytes; the next two are references (pointers) to arrays of bytes. KMT_MTM_VALUES is a union type allowing a variety of different types to appear. Note that WORD is a 32-bit unsigned integer, INT is a 32-bit signed integer; LONG makes it 64 bits. The last option in the union is marked REF()REF()BYTE, which means it is a pointer to an array whose members are pointers to arrays of bytes.

The final type declared here is a STRUCT, specifically a tuple containing two integers.

The program continues by declaring external procedures on which the module depends. RESPONSE indicates a return value containing error information:

 EXT PROC (RESPONSE)                              KMT_UI;     EXT PROC (REF INT,INT,RESPONSE)                  KMT_PH;     EXT PROC (REF INT,REF INT,RESPONSE)              KMT_PP_GET_PACKET,      PROC (INT,INT,BOOL,RESPONSE)                 KMT_PP_SEND_PACKET,      PROC (REF()BYTE,RESPONSE)            KMT_PP_BUILD_STRING_PACKET_DATA; 

and also some external variables:

 EXT REF () BYTE KMT_VERSION;     EXT REF BOOL ASG_ROUTE;     EXT REF()KMT_MTM_VALUES KMT_MTM_AREA;  EXT REF()BYTE MTM_TEXT;  EXT REF INT MTM_TEXT_LEN;  EXT REF ()REF ()BYTE MTM_RECALL_DATA; 

The rest of the program consists of a number of procedure definitions. One of these, which actually defines the entry point to the program, is reproduced here:

 GLOBAL STATIC (<STATUS 5;PSPACE 10001; TEMPLATE>) PROC KERMIT_THE_FROG IS        ((<LIT "COMMAND">)             REF()BYTE OPTION,         (<LIT ""       >)             REF()BYTE VME_FILE,         (<LIT ""       >)             REF()BYTE REM_FILE,         (<KEY RESPONSE;DEF N'RESULT>) RESPONSE RESULT):        BEGIN           ()BYTE JSV_NAME := "ASG";              @ obtain value for ASG_ROUTE bool @        CTM_JS_READ(JSV_NAME,NIL,NIL,ASG_ROUTE,RC_IGNORED);        IF RC_IGNORED NE 0 THEN ASG_ROUTE := FALSE FI;           @ verify parameter references (parameter values validated later):        @        @    OPTION   must be of mode REF () BYTE, may not be ZLR or NIL         @        @    VME_FILE must be of mode REF () BYTE, may be ZLR, must not be NIL   @        @    REM_FILE must be of mode REF () BYTE, may be ZLR, must not be NIL   @           UNLESS (VERIFY OPTION AND VALIDR OPTION)        AND    (VERIFY VME_FILE AND (VALIDR VME_FILE OR NOT(VME_FILE IS NIL)))        AND    (VERIFY REM_FILE AND (VALIDR REM_FILE OR NOT(REM_FILE IS NIL)))        THEN                                       @ invalid parameter reference @           RESULT := 10002 @ ARCH_INACCESSIBLE_PARAMETER @           ELSF                                             @ create resource block @           CTM_JS_BEGIN(RESULT);           RESULT <= 0        THEN                                            @ resource block created @           LONG LONG WORD KERMIT_RESULT;           ANY((3)LONG WORD AS_LW,(6) WORD AS_W) PARAMS;           PARAMS.AS_LW := (BDESC OPTION,BDESC VME_FILE,BDESC REM_FILE);                                                     @ set up program error handler @           IF  KMT_EH_INFORM_PE_CONTINGENCY(RESULT);                RESULT > 0           THEN                                    @ failed to set error handler @              SKIP           ELSF CTM_JS_CALL(NIL,PDESC KERMIT_SUPPORT,PARAMS.AS_W,KERMIT_RESULT,                            RESULT);                           @ create firewall @                RESULT <= 0           THEN                         @ either exited normally or via CTM_STOP @              RESULT := IF (S'S'KERMIT_RESULT) <= 0                        THEN 0                                 @ ignore warnings @                        ELSE 52000              @ error return common resultcode @                        FI           FI;              CTM_JS_END(RC_IGNORED)                           @ end resource block @        FI        END 

Features to note here include:

Related Research Articles

VME is a mainframe operating system developed by the UK company International Computers Limited. Originally developed in the 1970s to drive ICL's then new 2900 Series mainframes, the operating system is now known as OpenVME incorporating a Unix subsystem, and runs on ICL Series 39 and Trimetra mainframe computers, as well as industry-standard x64 servers.

x86 assembly language is the name for the family of assembly languages which provide some level of backward compatibility with CPUs back to the Intel 8008 microprocessor, which was launched in April 1972. It is used to produce object code for the x86 class of processors.

In computer programming, the term magic number has multiple meanings. It could refer to one or more of the following:

In the 80386 microprocessor and later, virtual 8086 mode allows the execution of real mode applications that are incapable of running directly in protected mode while the processor is running a protected mode operating system. It is a hardware virtualization technique that allowed multiple 8086 processors to be emulated by the 386 chip; it emerged from the painful experiences with the 80286 protected mode, which by itself was not suitable to run concurrent real mode applications well. John Crawford developed the Virtual Mode bit at the register set paving way to this environment.

ALGOL 68 Programming language

ALGOL 68 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 defined syntax and semantics.

In compiler construction, name mangling is a technique used to solve various problems caused by the need to resolve unique names for programming entities in many modern programming languages.

In computer programming, the term hooking covers a range of techniques used to alter or augment the behaviour of an operating system, of applications, or of other software components by intercepting function calls or messages or events passed between software components. Code that handles such intercepted function calls, events or messages is called a hook.

ALGOL 68-R was the first implementation of the Algorithmic Language ALGOL 68.

The Interactive ALGOL 68 compiler for ALGOL 68 was made available by Peter Craven of Algol Applications from 1984. Then in 1994 from OCCL until 2004.

ALGOL 68RS is the second ALGOL 68 compiler written by I. F. Currie and J. D. Morrison, at the Royal Signals and Radar Establishment (RSRE). Unlike the earlier ALGOL 68-R, it was designed to be portable, and implemented the language of the Revised Report.

Protel stands for "Procedure Oriented Type Enforcing Language". It is a programming language created by Nortel Networks and used on telecommunications switching systems such as the DMS-100. Protel-2 is the object-oriented version of Protel.

This article describes the syntax of the C# programming language. The features described are compatible with .NET Framework and Mono.

In computer science, marshalling or marshaling is the process of transforming the memory representation of an object into a data format suitable for storage or transmission. It is typically used when data must be moved between different parts of a computer program or from one program to another.

RTL/2 is a discontinued high-level programming language for use in real-time computing, developed at Imperial Chemical Industries, Ltd. (ICI), by J.G.P. Barnes. It was originally used internally in ICI but was distributed by SPL International in 1974. It was based on concepts from ALGOL 68, and intended to be small and simple. RTL/2 was standardised in 1980 by the British Standards Institution.

Charm is a computer programming language devised in the early 1990s with similarities to the RTL/2, Pascal and C languages in addition to containing some unique features of its own. The Charm language is defined by a context-free grammar amenable to being processed by recursive descent parser as described in seminal books on compiler design.

MessagePack is a computer data interchange format. It is a binary form for representing simple data structures like arrays and associative arrays. MessagePack aims to be as compact and simple as possible. The official implementation is available in a variety of languages such as C, C++, C#, D, Erlang, Go, Haskell, Java, JavaScript (NodeJS), Lua, OCaml, Perl, PHP, Python, Ruby, Scala, Smalltalk, and Swift.

In software engineering, the module pattern is a design pattern used to implement the concept of software modules, defined by modular programming, in a programming language with incomplete direct support for the concept.

Idris is a purely-functional programming language with dependent types, optional lazy evaluation, and features such as a totality checker. Idris may be used as a proof assistant, but it is designed to be a general-purpose programming language similar to Haskell.

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.

Nim (programming language) Programming language

Nim is a general-purpose, multi-paradigm, statically typed, compiled systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages.

References

  1. Hünke, Horst (1981). Software engineering environments (illustrated ed.). North-Holland Pub. Co. p. 83. ISBN   978-0-444-86133-7.
  2. "Kermit Software Source Code Archive". Columbia University's Kermit Project. 22 August 2011. Retrieved 1 March 2013.