HOME

TheInfoList



OR:

Mary is a
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming l ...
designed and implemented by
RUNIT runit is an init and service management scheme for Unix-like operating systems that initializes, supervises, and ends processes throughout the operating system. Runit is a reimplementation of the daemontools process supervision toolkit that ...
at
Trondheim Trondheim ( , , ; sma, Tråante), historically Kaupangen, Nidaros and Trondhjem (), is a city and municipality in Trøndelag county, Norway. As of 2020, it had a population of 205,332, was the third most populous municipality in Norway, an ...
,
Norway Norway, officially the Kingdom of Norway, is a Nordic country in Northern Europe, the mainland territory of which comprises the western and northernmost portion of the Scandinavian Peninsula. The remote Arctic island of Jan Mayen and t ...
in the 1970s. It borrowed many features from
ALGOL 68 ALGOL 68 (short for ''Algorithmic Language 1968'') 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 ...
but was designed for systems programming (machine-oriented programming). An unusual feature of its syntax was that expressions were constructed using the conventional
infix An infix is an affix inserted inside a word stem (an existing word or the core of a family of words). It contrasts with '' adfix,'' a rare term for an affix attached to the outside of a stem, such as a prefix or suffix. When marking text for i ...
operators, but all of them had the same precedence and evaluation went from left to right unless there were brackets. Assignment had the destination on the right and assignment was considered just another operator. Similar to C, several language features appear to have existed to allow producing reasonably well optimised code, despite a quite primitive code generator in the compiler. These included operators similar to the += ''et alter'' in C and explicit register declarations for variables. Notable features: *
Dataflow In computing, dataflow is a broad concept, which has various meanings depending on the application and context. In the context of software architecture, data flow relates to stream processing or reactive programming. Software architecture Da ...
syntax – values flow from left to right, including assignment * Most constructs could be used in expressions: blocks, IF, CASE, etc. * Text-based recursive macros * Overloaded user-defined operators, not constrained to predefined identifiers as in C++ * Automatic building and dereferencing of pointers from type context * Scalar range types * Array and set enumeration in loop iterators * Dynamic array descriptors (ROW) A book describing Mary was printed in 1974 (Fourth and last edition in 1979): ''Mary Textbook'' by Reidar Conradi & Per Holager. Compilers were made for
Kongsberg Våpenfabrikk Kongsberg Gruppen is an international technology group headquartered in Norway, that supplies High tech, high-technology systems to customers in the merchant marine, Defense industry, defence, aerospace, Offshore drilling, offshore oil and gas in ...
's SM-4 and Norsk Data Nord-10/ND-100 mini-computers. The original Mary compiler was written in NU
ALGOL ALGOL (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by th ...
, ran on the Univac-1100 series and was used to bootstrap a native compiler for
ND-100 The Nord-100 was a 16-bit minicomputer series made by Norsk Data, introduced in 1979. It shipped with the Sintran III operating system, and the architecture was based on, and backward compatible with, the Nord-10 line. The Nord-100 was origina ...
/
Sintran Sintran (a portmanteau of SINTEF and Fortran; stylized as SINTRAN) is a range of operating systems (OS) for Norsk Data's line of minicomputers. The original version of Sintran, was written in the programming language Fortran, released in 1968, ...
-III.
RUNIT runit is an init and service management scheme for Unix-like operating systems that initializes, supervises, and ends processes throughout the operating system. Runit is a reimplementation of the daemontools process supervision toolkit that ...
implemented a CHILL compiler written in Mary which ran on ND-100 and had
Intel 8086 The 8086 (also called iAPX 86) is a 16-bit microprocessor chip designed by Intel between early 1976 and June 8, 1978, when it was released. The Intel 8088, released July 1, 1979, is a slightly modified chip with an external 8-bit data bus (allow ...
and
80286 The Intel 80286 (also marketed as the iAPX 286 and often called Intel 286) is a 16-bit microprocessor that was introduced on February 1, 1982. It was the first 8086-based CPU with separate, non- multiplexed address and data buses and also th ...
targets. When this compiler was ported to the VAX platform, a common backend for Mary and CHILL was implemented. Later, backends for
i386 The Intel 386, originally released as 80386 and later renamed i386, is a 32-bit microprocessor introduced in 1985. The first versions had 275,000 transistorsSPARC SPARC (Scalable Processor Architecture) is a reduced instruction set computer (RISC) instruction set architecture originally developed by Sun Microsystems. Its design was strongly influenced by the experimental Berkeley RISC system developed ...
were available. Since the Mary compiler was implemented in Mary, it was possible to run the compiler on all these platforms. Mary is no longer maintained.


Example

BEGIN INT i := 10; %% Variable with initial value. REF INT ri := i; %% Pointer initialized to point to i. INT j := 11; j :- REF INT =: ri; %% Type conversion and assignment %% ri now points to j. i =: (ri :- VAL REF INT); %% Assignment and type conversion %% ri points to j so j is changed. IF j > 10 %% Conditional statement with result THEN %% used inside an arithmetic expression. 1 ELSE 2 FI + j =: j; END


See also

*
ALGOL 68 ALGOL 68 (short for ''Algorithmic Language 1968'') 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 ...
{{ALGOL programming ALGOL 68 dialect Norsk Data software Kongsberg Gruppen