NEWP. The New Executive Programming Language (NEWP) is an internal structured-syntax system language for Unisys Master Control Program (MCP) systems. The language is used for writing the MCP operating system and other system utility software, though it can also be used to write user system software with the restriction to not use UNSAFE mode.

Several constructs separate it from the extended ALGOL on which it is based. Language operators such as MEMORY, which allows direct memory access, are strictly used only by the MCP. NEWP replaced Burroughs Executive Systems Problem Oriented Language (ESPOL) in the 1970s.

NEWP is closely tied to the features and semantics of the platform and MCP itself. Since this is the case, there has never been a need for assembly language on these systems since ESPOL in 1961, and no assembler is provided, even for internal Burroughs/Unisys use. NEWP (and ESPOL) programmers are familiar with the way the machine works as a stack machine and the instruction set, since each source statement relates closely to the generated machine instructions.  This contributes to the platform as a secure multiprocessing system, since general programmers cannot use any assembler and NEWP is itself limited mostly to writing an operating system, particularly the MCP.

System programming is not just done in a single system language, but in a suite of system languages including Extended ALGOL, DCALGOL, DMALGOL, each suited to different levels of system programming, ensuring Separation of Concerns.

Customers may use NEWP to make site-specific patches to the MCP as well as their own system utilities. While NEWP can generate executable programs, such programs cannot use UNSAFE mode intended only for internal MCP operation.

Main constructs
NEWP is a block-structured language very similar to Extended ALGOL.  Although a lower-level system language than Extended ALGOL, NEWP includes stricter type checking. Thus programs compilable with ALGOL might not compile with NEWP.
NEWP includes several system features not available in ALGOL, and ALGOL variants DMALGOL and DCALGOL have extensions not in NEWP specifically for Data Management in Databases such as DMSII and Semantic Information Manager (SIM) and DCALGOL for higher-level transaction and server processing with request queues as in COMS (Communications Management System).

NEWP includes several features borrowed from other programming languages which help in software engineering. These include modules (and later, super-modules), which group together functions and their data, with defined import and export interfaces.  This allows for data encapsulation and module integrity.

UNSAFE Mode
Since NEWP is designed for use as an operating system language, it permits the use of several unsafe constructs. While the facilities are of very limited use, they are critical to the operation of the system and thus limited to specific areas of the operating system. Unsafe mode is for hardware specific operations. Any block containing unsafe instructions must be annotated with the specific kind of unsafe elements used.

Unsafe elements are only permitted within the operating system.  Executable programs generated by NEWP may not use unsafe elements (no unsafe blocks).
A block (a unit beginning with 'BEGIN' and ending with 'END') may include block directives in brackets. UNSAFE is one directive and includes various unsafe settings. For example:

   BEGIN [UNSAFE (DESCRIPTOR, WORD)]
      …
   END;

Unsafe elements are extra declarations and statements. Extra unsafe declarations include DESCRIPTOR, WORD, HARDLOCK.

DESCRIPTOR: Descriptors are memory block descriptors including address and other block metadata including block length, machine data type (byte or word), and presence bit for virtual memory operation.
Descriptors provide a high level of memory block protection with no possibility for memory (buffer) overflow or underflow.
As control words, descriptors may not be directly manipulated by any software element other than in the MCP operating system itself, thus ensuring memory safety and security.

HARDLOCK allows low-level locking on low-level shared resources.

WORD allows arbitrary bit access to any word, including machine control words (those with odd tags) and to the tag bits themselves. Any other software cannot arbitrarily modify control words or tags.

UNSAFE annotations include: DESCRIPTOR, MACHINEOPS, MEMORY, MISC, REFERENCE, REGISTERS, UPLEVEL, WORD.

MEMORY: At very low levels of an operating system, it must be able treat the machine as a single entity with a single physical memory. UNSAFE (MEMORY) allows the MCP to view the entire memory as a large one-dimensional array declared globally as M at lexical level 0 (D[0]). The scope of M is restricted to blocks annotated with UNSAFE [MEMORY]. Each array index of M is the address of a word in memory. The use of M is restricted to very low-levels of the MCP operating system.

REGISTERS: Being a stack machine, processor registers are generally hidden from software (not seen by programmers), including the top of stack registers. Register details may vary between hardware implementations, so it is desirable for software to not have any dependencies on register details. Some registers control specific operation of the hardware. Any software outside of specific sections of the MCP should not see registers. Thus most software is independent of many hardware details, these being isolated to sections of the MCP OS itself.

MACHINEOPS: Since there is no assembly language or assembler, NEWP provides intrinsics (certain NEWP instructions) to generate specific critical machine operations. With no assembler, general programmers cannot write programs to undermine system safety and security. The machine operators are enabled by the UNSAFE (MACHINEOPS) block annotation.

Two such notable intrinsics are STOP, that generates the machine instruction STOP instruction, and MOVESTACK which generates the MVST instruction that results in a process swap (a process being represented by a stack) flushing process-specific state to the current stack and restoring state from the target process (stack). Despite the importance of this intrinsic instruction to the multiprocessing operation of the system, the intrinsic itself only occurs in one place in the whole of the MCP.

Note that MCP calls execute on the stack of the current process. However, there are some MCP processes that are 'independent runners'.

If a NEWP program does not make use of any unsafe elements, it can be compiled and executed as a user-level program.  If any unsafe elements are used (in blocks annotated as UNSAFE), the compiler marks the code as non-executable.  Such a program can still be executed if blessed (specifically enabled) by a security administrator, with the appropriate console command.

Folklore
The exact origin of the language name 'NEWP' is clouded in history and mystery. NEWP is rumored to really stand for "Nearly Every Word Pascal" after a West Coast engineering initiative to move Burroughs languages such as ALGOL over to a more Pascal-like syntax.

Stories were also told that it stands for "No Executive Washroom Privileges," supposedly after its designers fell out of favor with management. Some engineers thought “Nothing Ever Works Perfectly” was a more fitting moniker.

Alternatively, NEWP was chosen as the name of the compiler/language at the spur of the moment by the designer when pressed for a name under which the compiler code would be managed.  It stood for "NEW Programming Language", an essentially dull name with the unhappy property that the "new" part of the name would quickly become incorrect.

The original designer of the project was a Texan and soon started to describe the name as the answer to the question, "Is it done yet?".  NEWP sounded like a West Texas version of "nope".  Once the project was released, the name was "redefined" to stand for "No Executive Washroom Privileges" - a description of the type of person who would likely use the language.

For a while, a contest ran to come up with a better name for the compiler and language, but by that time, the name NEWP had sunk its roots too deeply.

See also
Executive Systems Problem Oriented Language

References

ALGOL 60 dialect
Systems programming languages
Procedural programming languages