Protel

Last updated

Protel stands for "Procedure Oriented Type Enforcing Language". It is a programming language designed in 1975 by Nortel Networks and used on telecommunications switching systems such as the DMS-100. [1] [2] Protel-2 is the object-oriented version of Protel. [3] [4]

Contents

The PROTEL language was designed to meet the needs of digital telephony and is the basis of the DMS-100 line of switching systems. PROTEL is a strongly typed, block-structured language which is based heavily on PASCAL and ALGOL 68 with left-to-right style of variable assignment, variable-sized arrays, and extensible structures. The designers of PROTEL significantly extended PASCAL of the day by adding external compilation and extending the data structures available in the language. [3]

The PROTEL compiler is tightly integrated with the operating system (SOS), application (CALLP), the development environment (PLS) and originally the processor (NT40). PLS, SOS, CALLP and the compiler itself are all written in PROTEL. Any description of the PROTEL language can't help but include some aspects of the other components.

PROTEL has very strict type enforcement but the tight coupling of the components creates opportunities to bypass some type checking for skilled coders by using internal compiler features directly.

PROTEL is considered 'wordy', containing a large number of reserved words with some statements reading like English.

PROTEL source code is case insensitive but by convention upper case is used for reserved words.

Variables and Assignment

Most global and all local variables are declared using the DECL reserved word.

Variables can be initialized using INIT keyword.

Constants use IS keyword, hexadecimal uses #.

Global variables can also use PROTECTED, or PRIVATE declarations to define write protected data or thread local data respectively. Writes to protected data requires the use of builtin primitives that alter protected data in a safe way. Protected data survives all restarts short of a system image reload.

Note WRITE_PROTECTED_STORE arguments are type agnostic as long as the types of both arguments match.

PRIVATE provides a private copy of the data for each process that uses it. There is no COW functionality, each process is allocated its own copy and optionally initializes it at creation.

Note Local variables defined using DECL are naturally private.

GAZINTA

Gazinta is the colloquial name used for the assignment operator '->'. Its name comes from 'goes into' meaning expression gazinta (goes into) variable. Expressions are evaluated in strict left to right order with no operator precedence. Lack of operator precedence is a legacy of the NT40 processor which used a stack based ALU using RPN logic. Parentheses are used to prioritize subexpressions.

Pointers

The pointer operator is @ and is placed after the ptr. A NULL pointer is a predefined value that is guaranteed not to point to a mapped address. It is not 0 nor -1 nor another the predefined uninitialized memory pattern (#FDFD). In other words, a pointer is not NULL by default, it must be set in the code. Pointer arithmetic is not supported.

Note Dereferencing a NULL pointer will cause a data access trap.

Descriptors

The descriptor 'DESC' is a compiler defined structure containing a pointer to an array and the array upperbound. A descriptorized array is indexed using simple array syntax 'MY_DESC[I]' and the UPB operator can be used to access the upperbound 'UPB MYDESC'. A TDSIZE operator also exists as a legacy of the descriptor implementation on NT40: TDSIZE = UPB+1. Descriptors have automatic run time bounds checking on dynamically allocated arrays. Indexing a descriptor out of bounds or indexing a NULL descriptor will cause a descriptor range check trap. UPB is generally used by application software to more gracefully handle index out of range.

Note NULL can be used for pointers and descriptors.

Strings use descriptors extensively. Strings are of a defined length with no NULL character terminator.

Blocks

Block scope is defined by BLOCK and ENDBLOCK statements, which are analogous to BEGIN END in Pascal or { } in C. Blocks can optionally be labeled for enhanced compiler checking and functionality.

Procedures

Procedures and functions are only differentiated by the presence of the RETURNS clause and the requirement to include a RETURN statement. A RETURN statement may be inserted anywhere in a function or procedure.

Declaration

Implementation

Structures

The TABLE is the basic array structure. TABLE is only used for arrays whose size is known at compile time. Descriptors are the preferred way to reference arrays. Indexing a table out of range will cause a table range check trap. UPB and TDSIZE operators also apply to tables.

Unions

The OVERLAY is the basic union structure. It is declared and used in a manner similar to Pascal-descended languages.

AREAs

Areas are memory blocks that could be cast to TABLES and OVERLAYS. They are declared in bytes and typically are declared large enough to allow for future expansion. This is due to the desire to upgrade DMS software 'live' without requiring a restart. The modular nature of PROTEL allows relatively small chunks of code to be swapped into a load; if AREAs were planned smartly, this would not affect the placement of modules in memory, thereby avoiding a restart.

SUBSYSTEMs, MODULEs, and SECTIONs

A SECTION is a text file containing source code and directives to manage the different section types and their position in the module hierarchy. A SECTION is the smallest unit of compilation. A MODULE is the smallest unit of linkage and loading and contains one or more sections. A SUBSYSTEM is the smallest unit of packaging and contains one or more modules.

Control Flow

There are 2 forms of the case (switch) statement. Using the CASE keyword uses a jump table and SELECT uses sequential if-then-else logic. Cases are exclusive, they don't fall through as in C.

Related Research Articles

C is a general-purpose programming language. It was created in the 1970s by Dennis Ritchie and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of the targeted CPUs. It has found lasting use in operating systems code, device drivers, and protocol stacks, but its use in application software has been decreasing. C is commonly used on computer architectures that range from the largest supercomputers to the smallest microcontrollers and embedded systems.

The Cyclone programming language was intended to be a safe dialect of the C language. It avoids buffer overflows and other vulnerabilities that are possible in C programs by design, without losing the power and convenience of C as a tool for system programming. It is no longer supported by its original developers, with the reference tooling not supporting 64-bit platforms. The Rust language is mentioned by the original developers for having integrated many of the same ideas Cyclone had.

<span class="mw-page-title-main">Oberon (programming language)</span> General-purpose programming language

Oberon is a general-purpose programming language first published in 1987 by Niklaus Wirth and the latest member of the Wirthian family of ALGOL-like languages. Oberon was the result of a concentrated effort to increase the power of Modula-2, the direct successor of Pascal, and simultaneously to reduce its complexity. Its principal new feature is the concept of data type extension of record types. It permits constructing new data types on the basis of existing ones and to relate them, deviating from the dogma of strict static typing of data. Type extension is Wirth's way of inheritance reflecting the viewpoint of the parent site. Oberon was developed as part of the implementation of an operating system, also named Oberon at ETH Zurich in Switzerland. The name was inspired both by the Voyager space probe's pictures of the moon of the planet Uranus, named Oberon, and because Oberon is famous as the king of the elves.

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 after French mathematician, philosopher and physicist Blaise Pascal.

<span class="mw-page-title-main">Oberon-2</span> Programming language

Oberon-2 is an extension of the original Oberon programming language that adds limited reflective programming (reflection) and object-oriented programming facilities, open arrays as pointer base types, read-only field export, and reintroduces the FOR loop from Modula-2.

<span class="mw-page-title-main">C syntax</span> Set of rules defining correctly structured programs

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

<span class="mw-page-title-main">Pointer (computer programming)</span> 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.

In computer programming, run-time type information or run-time type identification (RTTI) is a feature of some programming languages that exposes information about an object's data type at runtime. Run-time type information may be available for all types or only to types that explicitly have it. Run-time type information is a specialization of a more general concept called type introspection.

In computer science, type safety and type soundness are the extent to which a programming language discourages or prevents type errors. Type safety is sometimes alternatively considered to be a property of facilities of a computer language; that is, some facilities are type-safe and their usage will not result in type errors, while other facilities in the same language may be type-unsafe and a program using them may encounter type errors. The behaviors classified as type errors by a given programming language are usually those that result from attempts to perform operations on values that are not of the appropriate data type, e.g., adding a string to an integer when there's no definition on how to handle this case. This classification is partly based on opinion.

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.

xHarbour is a free multi-platform extended Clipper compiler, offering multiple graphic terminals (GTs), including console drivers, GUIs, and hybrid console/GUIs. xHarbour is backward-compatible with Clipper and supports many language syntax extensions, greatly extended run-time libraries, and extensive third party support.

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.

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.

A class in C++ is a user-defined type or data structure declared with any of the keywords class, struct or union that has data and functions as its members whose access is governed by the three access specifiers private, protected or public. By default access to members of a C++ class declared with the keyword class is private. The private members are not accessible outside the class; they can be accessed only through member functions of the class. The public members form an interface to the class and are accessible outside the class.

sizeof is a unary operator in the programming languages C and C++. It generates the storage size of an expression or a data type, measured in the number of char-sized units. Consequently, the construct sizeof (char) is guaranteed to be 1. The actual number of bits of type char is specified by the preprocessor macro CHAR_BIT, defined in the standard include file limits.h. On most modern computing platforms this is eight bits. The result of sizeof has an unsigned integer type that is usually denoted by size_t.

PLANC is a high-level programming language.

C++11 is a version of a joint technical standard, ISO/IEC 14882, by the International Organization for Standardization (ISO) and International Electrotechnical Commission (IEC), for the C++ programming language. C++11 replaced the prior version of the C++ standard, named C++03, and was later replaced by C++14. The name follows the tradition of naming language versions by the publication year of the specification, though it was formerly named C++0x because it was expected to be published before 2010.

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.

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

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.

References

  1. Krishna, Sundeep Sahay, Brian Nicholson, S. (2003). Global IT outsourcing : software development across borders . Cambridge: Cambridge University Press. p.  7. ISBN   978-0521816045.{{cite book}}: CS1 maint: multiple names: authors list (link)
  2. Telesis (3), 1989{{citation}}: Missing or empty |title= (help)
  3. 1 2 “Experience with a modular typed language: PROTEL”, ICSE '81 Proceedings of the 5th international conference on Software engineering
  4. Dini, P.; Boutaba, R.; Logrippo, L., eds. (1997). Feature interactions in telecommunications networks IV. Amsterdam: IOS Press. p. 23. ISBN   978-9051993479.