Apple (programming language)

Last updated

Apple is a PL/I dialect programming language created by General Motors Research Laboratories for their Control Data Corporation STAR-100 supercomputer.

Contents

Apple is a subset of full PL/I, but has been extended to integrate with the Associative Programming Language (APL - not to be confused with APL (programming language) ) [1] :p.9 [2] :p.92

Associative programming features

Data types
Entity"The ENTITY attribute specifies a variable that may be manipulated by the INSERT, REMOVE, FIND, and FOR EACH statements." [1] :p.94
Set"The SET attribute defines the name of a data aggregate that represents an ordered set of entity variables." [1] :p.107
File_Set A File_Set is a SET that is contained in an external file.
Statements
CreateCreate is a synonym for Allocate. It causes storage to be allocated for a based variable. A file or set where the data is to be allocated may be specified.
DeleteDelete is a synonym for Free. Delete frees a based variable and optionally removes it from all sets of which it is a member.
FindLocate an entity that is a member of a set or container based on specified conditions. An optional ELSE clause is executed if no entities are found.
For EachHeads a group of statements to be executed for all entities or sets matching a specified condition.
InsertInsert an entity into a specified set. Optionally, the placement of the new entity relative to other elements of the set may be specified.
LetSet a locator variable to reference a specified set.
RemoveRemove an entity from a set.
Builtin function
ALLperforms various operations on all members of a set, depending on the context in which it appears.
APLESETreturns a value indicating whether or not a file-set has been created.
APLEVARreturns a pointer to the entity containing the set specified by its argument, or NULL if the set is a file-set.
APLINDX
APLNUMB
APLOWNI
APLOWRS
APLSNAM
APLTYPE

Other features

An OFFSET variable identifies the relative location of a based variable in the containing file. A DESCRIPTOR variable resembles a pointer variable, but also contains the length of the associated based variable in addition to its address.

The LOCK statement puts a program into "locked status", where all asynchronous events will be queued. A corresponding UNLOCK statement puts the program in "unlocked status", capable of processing asynchronous events. All queued events will be processed.

Asynchronous processing

Apple uses the PL/I EVENT data type to implement asynchronous processing.

An event variable can be associated with an external action, such as a keypress at the user's terminal, by a system call. Each event has a "delay state" and a "completion state" associated with it. When the event associated with the action occurs, the event becomes complete, and remains complete until the program accesses the information associated with the event. Events can also be marked complete with a SIGNAL statement, rather than the PL/I standard assignment to theCOMPLETION pseudovariable. An event can be put into a delay state by the DELAY pseudovariable, and recognition will remain deferred until the program resets the delay state.

Events can be associated with "ON-Units", by the ON EVENT statement, similar to PL/I standard for conditions. The REVERT statement removes the association. When the event is recognized (complete and not delayed) the On-Unit is executed. This ON-Unit can access system information about the event using the ONPTR builtin function, which returns the address of an "Event Completion Block", and sets the event to complete.

Hardware access

The REGISTER storage class and the INLINE builtin subroutine allow access to STAR hardware features.

A scalar arithmetic variable can be declared REGISTER [register-specification]. register-specification can be an unsigned integer constant 0..255 to specify one of the computer's hardware registers. If it is omitted the compiler will assign a register.[ citation needed ]

The INLINE builtin subroutine inserts an arbitrary machine-language instruction into the compiled code. Except for the function code (operation code) and subcode of the instructions all operands can be numeric constants, variables, or arithmetic constants.

Example: [1] :p.202

 CALL INLINE("F8", 5, 0, SOURCE, 0, "20", 0, TARGET);

Text replacement

The LITERALLY specification allows the programmer to specify replacement text to be substituted at compile time. The syntax is:

 %DECLARE <identifier> LITERALLY [ (<parameter-list> ) ] <character-constant> ;

If <parameter-list> is not specified the compiler replaces all occurrences of <identifier> throughout the program with <character-constant>.If <parameter-list> is specified, the replacement character string is formed by replacing all occurrences of the parameter name with the corresponding argument.

Example:

 %DECLARE BITS LITERALLY(A1,A2) 'A1*A2*64';  I = BITS(J,B);

will generate the statement:

 I=J*8*64;

Omitted PL/I features

Some features of standard PL/I are not included in Apple. The most significant are: [1]

Related Research Articles

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.

An optimizing compiler is a compiler designed to generate code that is optimized in aspects such as minimizing program execution time, memory use, storage size, and power consumption.

In computer science, control flow 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 imperative programming language from a declarative programming language.

<span class="mw-page-title-main">Atari BASIC</span> Dialect of the BASIC programming language

Atari BASIC is an interpreter for the BASIC programming language that shipped with Atari 8-bit computers. Unlike most American BASICs of the home computer era, Atari BASIC is not a derivative of Microsoft BASIC and differs in significant ways. It includes keywords for Atari-specific features and lacks support for string arrays.

In computing, inline expansion, or inlining, is a manual or compiler optimization that replaces a function call site with the body of the called function. Inline expansion is similar to macro expansion, but occurs during compilation, without changing the source code, while macro expansion occurs prior to compilation, and results in different text that is then processed by the compiler.

A stored procedure is a subroutine available to applications that access a relational database management system (RDBMS). Such procedures are stored in the database data dictionary.

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">A+ (programming language)</span> Programming language

A+ is a high-level, interactive, interpreted array programming language designed for numerically intensive applications, especially those found in financial applications.

Loop unrolling, also known as loop unwinding, is a loop transformation technique that attempts to optimize a program's execution speed at the expense of its binary size, which is an approach known as space–time tradeoff. The transformation can be undertaken manually by the programmer or by an optimizing compiler. On modern processors, loop unrolling is often counterproductive, as the increased code size can cause more cache misses; cf. Duff's device.

In computer programming, an entry point is the place in a program where the execution of a program begins, and where the program has access to command line arguments.

In computer software, in compiler theory, an intrinsic function, also called built-in function or builtin function, is a function (subroutine) available for use in a given programming language whose implementation is handled specially by the compiler. Typically, it may substitute a sequence of automatically generated instructions for the original function call, similar to an inline function. Unlike an inline function, the compiler has an intimate knowledge of an intrinsic function and can thus better integrate and optimize it for a given situation.

In computer science, a call stack is a stack data structure that stores information about the active subroutines of a computer program. This type of stack is also known as an execution stack, program stack, control stack, run-time stack, or machine stack, and is often shortened to simply "the stack". Although maintenance of the call stack is important for the proper functioning of most software, the details are normally hidden and automatic in high-level programming languages. Many computer instruction sets provide special instructions for manipulating stacks.

Interprocedural optimization (IPO) is a collection of compiler techniques used in computer programming to improve performance in programs containing many frequently used functions of small or medium length. IPO differs from other compiler optimizations by analyzing the entire program as opposed to a single function or block of code.

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.

OpenHMPP - programming standard for heterogeneous computing. Based on a set of compiler directives, standard is a programming model designed to handle hardware accelerators without the complexity associated with GPU programming. This approach based on directives has been implemented because they enable a loose relationship between an application code and the use of a hardware accelerator (HWA).

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, procedure, method, subroutine, routine, or subprogram is a callable unit of software logic that has a well-defined interface and behavior and can be invoked multiple times.

PL/SQL is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database, TimesTen in-memory database, and IBM Db2. Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database.

The PL/I preprocessor is the preprocessor for the PL/I computer programming language. The preprocessor interprets a subset of the full PL/I language to perform source file inclusion, conditional compilation, and macro expansion.

The Associative Programming Language (APL) is a database language developed by General Motors Research Laboratories in 1966.

References

  1. 1 2 3 4 5 Krull, Fred; Marcotty, Michael; Pickrtt, Mary; Thomas, James; Zeilinger, Ronald (1972). Apple Reference Manual (PDF). General Motors Research Laboratories. Retrieved June 29, 2024.
  2. Bachman, Charles (January 2006). An interview with Charles W. Bachman. doi:10.1145/1141880.1141882. ISBN   978-1-4503-1771-9 . Retrieved June 29, 2024 via ACM Digital Library."George [Dodd] built a very attractive IDS like system, called 'Associative Programming Language' (APL) which was integrated with PL/1. General Motors used it extensively in the graphic design system for automotive development. IBM latter asked GM to give up the initials, APL, so they could use them with their, 'A Programming Language.'”