ALGOL 68RS

ALGOL 68RS
Original author(s)I. F. Currie, J. D. Morrison
Developer(s)Royal Signals and Radar Establishment
Initial releaseAugust 1977; 47 years ago (1977-08)
Final release
algol68toc 1.14 / 25 August 2012; 12 years ago (2012-08-25)
Written inALGOL 68
Operating systemVMS
PlatformICL 2900 Series, Multics, VAX
Available inEnglish
TypeCompiler, translator
LicenseFreeware, public domain (parts)
Websitealgol68.sourceforge.net

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).[1] Unlike the earlier ALGOL 68-R, it was designed to be portable, and implemented the language of the Revised Report.

Versions of ALGOL 68RS were written for the ICL 2900 Series, Multics, and VAX running VMS.[2][3]

Subsequently, parts of this compiler were released into the public domain, as a translator from ALGOL 68 to C, as part of the public release of the hardware description language ELLA, also by the RSRE.

History

Although the ALGOL 68-R compiler, written by I.F. Currie, J.D. Morrison, and S.G. Bond, was a great success, it suffered from two major problems: it had been written for the nearly obsolete ICL 1900 computer, and it implemented an out-of-date version of the language as it was released before the Revised Report on ALGOL 68 was available.

RSRE needed a newer compiler for various internal projects, so the team of Currie and Morrison wrote a new compiler designed for cross-platform software portability between machines. The compiler dealt with the parsing of ALGOL 68, producing a high level intermediate language known as stream language that is then compiled to machine code by a translator. The compiler needed to know only the sizes of the various object machine data types and the character encoding (set) available.

The compiler was written in ALGOL 68, bootstrapped initially using the ALGOL 68-R compiler.

A team of two programmers at Oxford University Computing Services wrote a code generator for the ICL 2900 series.[4] Martyn Thomas of South West Universities Regional Computer Centre (SWURCC) arranged that this system be sponsored by International Computers Limited (ICL) and sold as an official ICL product.[5]

Later, the Avon Universities Joint Computer Centre, a large user of Multics requested the SWURCC team to produce a Multics version of ALGOL 68RS. A version for the Digital Equipment Corporation (DEC) VAX computer was also written.

Eventually the team at SWURCC formed a company, Praxis, initially supporting the Multics version of ALGOL 68RS.

RSRE also used the ALGOL 68RS compiler for internal projects, including the Flex machine and the ELLA hardware design language. When it was decided to make ELLA freely available, Praxis was commissioned to write an ALGOL 68 to C translator named ctrans, based on the ALGOL 68RS compiler.

Restrictions in the language compiled

Like the earlier ALGOL 68-R compiler, ALGOL 68RS was a one-pass compiler, which required some restrictions on the language compiled.

Declaration before use

The ALGOL 68 program:

PROC even = (INT number) BOOL: ( number = 0 | TRUE | odd (ABS (number - 1)));
PROC odd = (INT number) BOOL: ( number = 0 | FALSE | even (ABS (number - 1)));

would have to be re-written as:

PROC (INT) BOOL odd;
PROC even = (INT number) BOOL : ( number = 0 | TRUE | odd (ABS (number - 1)));
odd := (INT number) BOOL : ( number = 0 | FALSE | even (ABS (number - 1)));

To allow recursive declarations of modes (types) a special stub mode declaration was used to inform the compiler that an upcoming symbol was a mode rather than an operator:

MODE B,
     A = STRUCT (REF B b),
     B = [1:10] REF A;

Parallel processing

Like ALGOL 68-R, the operators PAR clause and the SEMA mode with its associated UP, DOWN, and LEVEL, were omitted.

Extensions to ALGOL 68

Straightening

One major misfeature of ALGOL 68 is that it is impossible to write the standard transput (input/output) procedures in pure ALGOL 68. The print procedure takes, for example, an array of items to print of any mode and, by a process named straightening, converts them into simple values that can be printed. For example:

STRUCT (INT a, REAL b) c := ...;

print(c);   { magically transformed to print ((a OF c, b OF c)); }

The writers of ALGOL 68RS decided to make straightening available as part of the language. A STRAIGHT mode resembles an array but has the special feature that items can be coerced to a STRAIGHT mode if their components can be coerced to the mode. For example:

STRUCT (INT a, REAL b) c;

STRAIGHT UNION (INT, REAL) z = c;

Both the fields of C can be coerced to UNION (INT, REAL) so the field "a OF c" can be accessed as z[1] and "b OF c" is z[2].

The standard print procedure can now be declared as:

MODE PRINTMODE = UNION (INT, REAL, ... STRAIGHT PRINTMODE);
PROC print = ([] PRINTMODE arguments ) VOID: ...;

Efficient array handling

The ALGOL 68 array modes are very powerful, including multiple dimensions, defined upper and lower bounds, trimming (making a new array by taking a contiguous subset of an array), slicing (making a new array by removing one dimension from an array), and rowing (making a new array by adding a dimension to an extant array.

For example:

[5:23, -7:7] INT a;               { a two dimensional array }
REF [,] INT b = a [ 6:21, 0:3 ]   { a slice of a }
REF [] INT c = a [5]              { just one row of a }

While the compiler made all efforts to generate optimal code for all cases, it was felt that adding some simpler facilities would allow better code in some cases. To this end ALGOL 68RS included indexable structures (i-structs), vectors, and the FORALL statement.

Indexable structures

ALGOL 68 already included fixed length structures to efficiently handle characters and bit-data on word-based machines, the BYTES and BITS modes. A BYTES variable held one machine word of characters, a BITS variable held the bits of one machine word.

ALGOL 68RS generalised these ideas. A STRUCT 4 CHAR variable held exactly 4 chars. The size was part of the type. On most ALGOL 68RS systems, the mode BYTES was equivalent to STRUCT 4 CHAR.

MODE BYTES = STRUCT 4 CHAR;
OP ELEM = (INT index, BYTES val) CHAR: val[index];
...
BYTES b = "abcd";
...
print (2 ELEM b);

The ALGOL 68RS compiler would compile any string constant to an appropriate STRUCT n CHAR.

In contexts where a VECTOR or array was wanted, an i-struct could be widened to the appropriate VECTOR or array type.

Vectors

A VECTOR is a simplified array, with only one dimension and a lower bound fixed at 1.

VECTOR [4] INT a;     { similar to [1:4] INT a; }

In any context where an array was required a VECTOR could be converted to an array.

FORALL statement

The FORALL statement allows efficient stepping through the elements of an array.

[12] INT a := ...;

FORALL xa IN a
DO xa := xa * 2
OD

xa will be a reference to each element of a in turn. FORALL can step through multiple arrays in parallel, and be controlled by a WHILE clause:

[12] INT a, b;
...
FORALL xa IN a,
       xb IN b
WHILE xa > xb
DO
    f(xa, xb)
OD

Separate compiling

ALGOL 68RS provided a mechanism to build libraries similar to the separate compiling facilities of ALGOL 68-R and a mechanism to build programs in a top-down manner similar to those of ALGOL 68C.

Declaration modules

Libraries in ALGOL 68RS are written using declaration modules which consist of a sequence of MODE, variable, operator and procedure declarations followed by a keep list which defines which declarations are visible to other segments.

The library user then adds a USE header that tells the compiler to make the symbols of one or more declaration libraries available to the program.

For example, a graphics library might be written as:

DECS graphlib
USE some other library

MODE GRAPHDATA = STRUCT ( ... );
MODE GRAPH = REF GRAPHDATA;
PROC new graph = ( ... ) GRAPH : ...;
PROC draw graph = (GRAPH g) VOID : ...;
   ...

KEEP GRAPH, new graph, draw graph
FINISH

And a user program to use this library would look like:

PROGRAM myprog
USE graphlib
BEGIN
    GRAPH g = new graph (...);
    ...
    draw graph (g);
    ...
END
FINISH

Nested modules

To support a top-down programming style, ALGOL 68RS provided the HERE and CONTEXT facilities.

A program could be written with parts to be filled in later marked by a HERE tag followed by a keeplist of declarations to be made available.

PROGRAM (pass1, pass2) compiler
BEGIN
   STRING source := ...;
   TREE parsetree;
...
   HERE pass1 (source, parsetree);
...
   INSTRUCTIONS insts;
   HERE pass2 (parsetree, insts);
...
END
FINISH

The code to be executed in the context of the HERE tags would be written as:

PROGRAM pass1 implementation
CONTEXT pass1 IN compiler
BEGIN
  ...   { code using "source" and "parsetree" }
END
FINISH

HERE is similar to the ALGOL 68C ENVIRON and CONTEXT is equivalent to the ALGOL 68C USING.

Code and alien access

ALGOL 68RS was intended to be usable for low level systems programming. To allow this, facilities were included for access to machine code and non-ALGOL 68RS objects.

Code was inserted with the CODE construct:

SOMEMODE CODE (item1, item2, ...) "...code..."

Where the items are ALGOL 68RS values to be made available to the code insertion and SOMEMODE is the mode returned. The mode can be omitted if the code returns no value.

Access to non-ALGOL68 objects was available with the ALIEN insertion:

SOMEMODE name = ALIEN "external-name"

Any simple ALGOL 68RS object could be cast into a VECTOR of characters using the SPELL operator:

STRUCT (INT a, REAL b) c = ...;

print (("internal repr = ", SPELL c, newline));

A simple object is one that contains no arrays or VECTORs.

Availability

The ALGOL 68 to C translator written by Praxis for the ELLA system contains most of the ALGOL 68RS compiler. The notable exception is the code for handling FORMATs.

As of September 2020, ALGOL 68RS is available from SourceForge.[6]

References

  1. ^ Bond, S. G.; Woodward, P. M. (August 1977). "Introduction to the 'RS' Portable ALGOL 68 Compiler". Technical Note (802). Archived from the original on 14 December 2012.
  2. ^ Woodward, P. M.; Bond, S. G. (1983). Guide to ALGOL 68 for Users of RS Systems. Edward Arnold (Publishers) Ltd. ISBN 978-0-7131-3490-2.
  3. ^ Lindsey, C. H. (August 1998). "Survey of Viable ALGOL 68 Implementations". ALGOL Bulletin (52): 5–8. ISSN 0084-6198.
  4. ^ "Multics Site History: Avon".
  5. ^ Lindsey, C. H. (December 1980). "ALGOL 68 Implementations: The ICL 2900 Compiler". ALGOL Bulletin (46): 7–8. ISSN 0084-6198.
  6. ^ van der Veer, Marcel; NevilleDNZ. "Open source ALGOL 68 implementations". SourceForge. Retrieved 18 September 2020.

Read other articles:

Mr Midnight AuthorJames LeeOriginal titleMr MidnightCountrySingaporeLanguageEnglishGenreHorror fictionPublisherAngsana Books, Flame Of The Forest Publishing (flameoftheforest.com)Publication date1998 (Earliest, Mr Midnight #1)2023 (Latest, Mr Midnight #SE 28) Mr Midnight (US title: Mr. Midnight) is a children's horror fiction book series written by Jim Aitchison under the pseudonym of James Lee. The series is published by Angsana Books, Flame Of The Forest Publishing. There are currently...

 

Ignatius Imam Kuseno Miharjo Direktur Jenderal Bimbingan Masyarakat KatolikMasa jabatan21 April 1986 – 18 Juli 1997MenteriMunawir SjadzaliTarmizi Taher PendahuluIgnatius Djoko MuljonoPenggantiJ.T. Sukotjoatmodjo (Plh.)F.X. Sutaryo (Plh.)A.I. Sumardjono (Plh.)J.T. SukotjoatmodjoAnggota Majelis Permusyawaratan RakyatMasa jabatan1 Oktober 1982 – 1 Oktober 1987PresidenSoeharto Informasi pribadiLahir(1937-07-11)11 Juli 1937Salatiga, Jawa Tengah, Hindia BelandaMeninggal15 Dese...

 

Australian tennis player (born 1971) Todd WoodbridgeOAMWoodbridge at the 2004 Wimbledon ChampionshipsFull nameTodd Andrew WoodbridgeCountry (sports) AustraliaResidenceSydney, New South Wales, AustraliaBorn (1971-04-02) 2 April 1971 (age 53)Sydney, New South Wales, AustraliaHeight178 cm (5 ft 10 in)[1]Turned pro1988Retired2005PlaysRight-handed (one-handed backhand)Prize moneyUS$ 10,078,820Int. Tennis HoF2010 (member page)SinglesCareer record...

Policy on permits required to enter Somaliland Not to be confused with Visa policy of Somalia. Politics of Somaliland Constitution Constitution Government Government President (List) Muse Bihi Abdi Vice President Abdirahman Saylici Council of Ministers Legislative Parliament House of Elders Chairman: Suleiman Mohamoud Adan House of Representatives Speaker: Yasin Haji Mohamoud Judiciary Judiciary of Somaliland Ministry of Justice Chief Justice of Somaliland Administrative divisions Regions Dis...

 

Wilmer ValderramaWilmer Valderrama at opening of Marquee nightclub in Sydney, AustraliaLahirWilmer Eduardo Valderrama30 Januari 1980 (umur 44)Miami, Florida, Amerika SerikatNama lainEduardo FrescoPekerjaanAktor, aktor suara, penyanyi, penari, produserTahun aktif1998–sekarang Wilmer Eduardo Valderrama (lahir 30 Januari 1980) adalah seorang aktor dan presenter televisi Amerika Serikat, dikenal dengan perannya sebagai Fez dalam sitkom That '70s Show dan Spesial Agen Torres dala...

 

LamhePoster rilis teatrikalSutradaraYash ChopraProduserYash ChopraT. Subbarami ReddyDitulis olehHoney IraniRahi Masoom RazaPemeranSrideviAnil KapoorWaheeda RehmanAnupam KherPenata musikShiv-HariSinematograferManmohan SinghDistributorYash Raj FilmsTanggal rilis22 November 1991Durasi187 menitBahasaHindiAnggaran₹6 crore (setara dengan ₹37 crore atau US$5,2 juta pada tahun 2023)Pendapatankotor₹20,5 crore (setara dengan ₹13 milyar atau US$180 juta ...

Coppa di Portogallo 1966-1967Taça de Portugal 1966-1967 Competizione Taça de Portugal Sport Calcio Edizione 27ª Luogo  Portogallo Partecipanti 46 Risultati Vincitore  Vitória Setúbal(2º titolo) Secondo  Académica Semi-finalisti  Porto Braga Statistiche Miglior marcatore Artur Jorge Ernesto (12) Incontri disputati 90 Gol segnati 333 (3,7 per incontro) Cronologia della competizione 1965-1966 1967-1968 Manuale La Taça de Portugal 1966-1967 fu la 27ª e...

 

Sébastien Pocognoli Pocognoli bermain untuk Belgia pada tahun 2008Informasi pribadiTanggal lahir 1 Agustus 1987 (umur 36)Tempat lahir Seraing, BelgiaTinggi 1,82 m (5 ft 11+1⁄2 in)[1]Posisi bermain BekInformasi klubKlub saat ini Brighton & Hove Albion(pinjaman dari West Bromwich Albion)Nomor 12Karier junior2000–2005 Standard LiègeKarier senior*Tahun Tim Tampil (Gol)2005–2007 Genk 45 (1)2007–2010 AZ Alkmaar 64 (5)2010–2013 Standard Liège 85 (2)2...

 

Anjing liar afrika Periode Pleistosen Tengah – sekarang (200,000–Saat ini)[1] Lycaon pictus Rekaman Status konservasiGentingIUCN12436 TaksonomiKerajaanAnimaliaFilumChordataKelasMammaliaOrdoCarnivoraFamiliCanidaeGenusLycaonSpesiesLycaon pictus (Temminck, 1820) Tata namaProtonimHyaena picta Distribusi lbs Anjing liar afrika (Lycaon pictus) adalah anjing liar yang penyebarannya hanya terdapat di negara-negara di benua Afrika.[2] Berbeda dengan jenis anjing pada umumnya, anjin...

PT International Chemical IndustryJenisPerseroan terbatasIndustriBaterai listrikDidirikan1959; 65 tahun lalu (1959) di MedanPendiriChandra Djojonegoro[1]Chu Sok SamKantorpusatJakarta, IndonesiaTokohkunciHusain Djojonegoro (Presiden Direktur)ProdukBaterai ABCPemilikABC HoldingSitus webwww.abc-battery.com PT International Chemical Industry atau PT Intercallin adalah perusahaan yang memproduksi baterai listrik dan senter dengan merek ABC. Perusahaan ini didirikan di Medan pada tahun...

 

National forest in the U.S. state of North Carolina Uwharrie National ForestFishing pier at Kings Mountain Point Day Use AreaShow map of North CarolinaShow map of the United StatesLocationNorth Carolina, United StatesNearest cityAlbemarle, NCCoordinates35°21′59″N 79°57′51″W / 35.3663062°N 79.964034°W / 35.3663062; -79.964034Area50,645 acres (204.95 km2)[1]EstablishedJanuary 12, 1961[2]Governing bodyU.S. Forest ServiceUwharrie ...

 

US Navy complex in Italy Naval Support Activity NaplesCapodichino, Naples, Campania in ItalyA parade at NSA Naples in 2013NSA NaplesLocation in ItalyCoordinates40°52′56.6″N 14°17′32.5″E / 40.882389°N 14.292361°E / 40.882389; 14.292361TypeNaval Support ActivitySite informationOwnerItalian Ministry of DefenceOperatorUS NavyControlled byCommander, Navy Region Europe, Africa, CentralConditionOperationalWebsiteOfficial websiteSite historyBuilt1951 ...

One of the first African Americans to become a U.S. Navy Master Diver Carl BrashearBirth nameCarl Maxie BrashearBorn(1931-01-19)January 19, 1931Tonieville, Kentucky, U.S.DiedJuly 25, 2006(2006-07-25) (aged 75)Portsmouth, Virginia, U.S.AllegianceUnited StatesService/branchUnited States NavyYears of service1948–1979RankMaster Chief Petty OfficerBattles/warsKorean WarAwardsNavy and Marine Corps MedalNavy and Marine Corps Commendation MedalNavy and Marine Corps Achievement Medal Carl ...

 

Team representing New Zealand in men's international football competitions This article is about the men's team. For the women's team, see New Zealand women's national football team. New ZealandNickname(s)All WhitesAssociationNew Zealand Football (NZF)ConfederationOFC (Oceania)Head coachDarren BazeleyCaptainChris WoodMost capsIvan Vicelich (88)Top scorerChris Wood (34)Home stadiumVariousFIFA codeNZL First colours Second colours FIFA rankingCurrent 107 3 (20 June 2024)[1]Highest47 (Aug...

 

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada Februari 2023. Ini adalah daftar lagu posisi pertama di Amerika Serikat selama tahun 1942 menurut majalah Billboard. Daftar Nasional Penjualan Rekaman Eceran Terbaik adalah polling pengecer nasional pertama pada rekor penjualan. Tangga lagu baru diistilahkan sebagai...

City in Hampshire, England This article is about the English city. For other uses, see Winchester (disambiguation). City in EnglandWinchesterCityClockwise from top left: Winchester Cathedral, Great Minster Street, Great Hall of Winchester Castle and Winchester GuildhallCoat of arms of WinchesterWinchesterLocation within HampshirePopulation48,478 [1]OS grid referenceSU485295• London60 miles (97 km)DistrictWinchesterShire countyHampshireRegionSouth EastCo...

 

Square matrix symmetric about both its diagonal and anti-diagonal Symmetry pattern of a bisymmetric 5 × 5 matrix In mathematics, a bisymmetric matrix is a square matrix that is symmetric about both of its main diagonals. More precisely, an n × n matrix A is bisymmetric if it satisfies both A = AT (it is its own transpose), and AJ = JA, where J is the n × n exchange matrix. For example, any matrix of the form [ a b c d e b f g h d c g i g c d h g f b e d c b a ] = [ a 11 a 12 a ...

 

金星探査機「あかつき (PLANET-C)」 相模原市立博物館に展示された模型所属 宇宙科学研究所 (ISAS)現・宇宙航空研究開発機構 (JAXA)主製造業者 NEC東芝スペースシステム公式ページ 金星探査機 あかつき国際標識番号 2010-020Dカタログ番号 36576状態 運用中目的 金星気象探査観測対象 金星設計寿命 打上げ後4.5年打上げ場所 種子島宇宙センター打上げ機 H-IIAロケット 17号機打上�...

Un petit déjeuner indonésien typique. La cuisine indonésienne regroupe les plats habituellement consommés dans l'archipel indonésien. À l'image des langues, cultures et ethnies, la cuisine indonésienne est très riche et variée ; elle est basée sur les produits de la mer, des hautes terres et des plaines tropicales ; la cuisine indonésienne n'est pas saisonnière, bien que certains fruits ne soient disponibles qu'à certains moments de l'année. Elle est basée sur les tr�...

 

American film director and actor (1872–1937) This article is about the film director and actor. For the brother of Arthur Sullivan, see Fred Sullivan. For the sheriff, see Frederick R. Sullivan. Frederic Richard SullivanSullivan in 1921Born(1872-07-18)18 July 1872London, EnglandDied24 July 1937(1937-07-24) (aged 65)Los Angeles, California, United StatesOccupation(s)Film directorActor Frederic Richard Dickie Sullivan[1] (sometimes credited as Frederick; 18 July 1872 – 24 J...