# Autocode

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Autocode
> Markdown URL: https://mediated.wiki/source/Autocode.md
> Source: https://en.wikipedia.org/wiki/Autocode
> Source revision: 1351697269
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Early computer programming languages}}
{{For|the assembly language used with the IBM 1400 series|Autocoder}}
{{Use dmy dates|date=March 2020|cs1-dates=y}}
'''Autocode''' is the name of a family of "simplified coding systems", later called [programming languages](/source/high-level_programming_language), devised in the 1950s and 1960s for a series of  [digital computer](/source/digital_computer)s at the Universities of [Manchester](/source/University_of_Manchester), [Cambridge](/source/University_of_Cambridge) and [London](/source/University_of_London). Autocode was a generic term; the autocodes for different machines were not necessarily closely related as are, for example, the different versions of the single language [Fortran](/source/Fortran).

Today the term is used to refer to the family of early languages descended from the [Manchester Mark 1](/source/Manchester_Mark_1) autocoder systems, which were generally similar. In the 1960s, the term '''autocoders''' was used more generically as to refer to any [high-level programming language](/source/high-level_programming_language) using a [compiler](/source/compiler).<ref name=kleith>{{cite book|last=London|first=Keith|title=Introduction to Computers|year=1968|publisher=Faber and Faber Limited|location=London |sbn=571085938|page=184|edition=1st|chapter=4, Programming|quote=The 'high' level programming languages are often called autocodes and the processor program, a compiler.}}<!-- There is no typo in the previous sentence. --></ref> 
Examples of languages referred to as autocodes are [COBOL](/source/COBOL) and [Fortran](/source/Fortran).<ref name=kleith2>{{cite book|last=London|first=Keith|title=Introduction to Computers|year=1968|publisher=Faber and Faber Limited|location=London |sbn=571085938|page=186|edition=1st|chapter=4, Programming|quote=Two high level programming languages which can be used here as examples to illustrate the structure and purpose of autocodes are COBOL (Common Business Oriented Language) and FORTRAN (Formular Translation).}}<!-- There is no typo in the previous sentence.--></ref>

== Glennie's Autocode ==
The first autocode and its compiler were developed by [Alick Glennie](/source/Alick_Glennie) in 1952 for the Mark 1 computer at the University of Manchester and is considered by some to be the first [compiled](/source/compiler) programming language. His main goal was increased comprehensibility in the programming of Mark 1 machines, which were known for their particularly abstruse machine code. Although the resulting language was much clearer than the machine code, it was still very machine dependent.<ref>Knuth, p. 42-43</ref>

Below is an example of Glennie's Autocode function which calculates the formula: <math>f(t) = \sqrt{|t|} + 5t^3</math>. The example omits necessary scaling instruction needed to place integers into variables and assumes that results of multiplication fit into lower accumulator.

 c@VA t@IC x@½C y@RC z@NC
 INTEGERS +5 →c           # Put 5 into c
       →t                 # Load argument from lower accumulator
                          # to variable t
    +t     TESTA Z        # Put |t| into lower accumulator
    -t
           ENTRY Z
 SUBROUTINE 6 →z          # Run square root subroutine on
                          # lower accumulator value
                          # and put the result into z
   +tt →y →x              # Calculate t^3 and put it into x 
   +tx →y →x
 +z+cx   CLOSE WRITE 1    # Put z + (c * x) into
                          # lower accumulator
                          # and return

User's manual of Glennie's Autocode Compiler mentioned that "the loss of efficiency is no more than 10%".<ref>Knuth, p. 48</ref>

Impact of Glennie's Autocode on other Manchester users' programming habits was negligible. It wasn't even mentioned in Brooker's 1958 paper called "The Autocode Programs developed for the Manchester University Computers".

== Mark 1 Autocode ==
<!-- section title used in redirects -->
The second autocode for the Mark 1 was planned in 1954 and developed by [R. A. Brooker](/source/Tony_Brooker) in 1955 and was called the "Mark 1 Autocode". The language was nearly machine-independent and had floating-point arithmetic, unlike the first one. On the other hand it allowed only one operation per line, offered few mnemonic names and had no way to define user subroutines.<ref>Knuth, p. 63-64</ref>

An example code which loads array of size 11 of floating-point numbers from the input would look like this

       n1 = 1         
 1    vn1 = I         reads input into vn[1]
       n1 = n1 + 1
    j1,11 ≥ n1        jumps to 1 if n[1] ≤ 11

Brooker's Autocode removed two main difficulties of Mark 1's programmer: scaling and management of two-level storage. Unlike its predecessor it was heavily used.<ref>Knuth, p. 65</ref>

== {{anchor|Mercury Autocode|Pegasus Autocode|Titan Autocode}}Later Autocodes ==
Brooker also developed an autocode for the [Ferranti Mercury](/source/Ferranti_Mercury) in the 1950s in conjunction with the University of Manchester.
''Mercury Autocode'' had a limited repertoire of [variables](/source/Variable_(programming)) a-z and a'-z' and, in some ways resembled early versions of the later [Dartmouth BASIC](/source/Dartmouth_BASIC) language.  It pre-dated [ALGOL](/source/ALGOL), having no concept of [stack](/source/Call_stack)s and hence no [recursion](/source/recursion) or [dynamically-allocated](/source/dynamic_memory_allocation) [arrays](/source/Array_data_structure).  In order to overcome the relatively small store size available on Mercury, large programs were written as distinct "chapters", each of which constituted an [overlay](/source/Overlay_(programming)).  Some skill was required to minimise time-consuming transfers of control between chapters.  This concept of overlays from [drum](/source/drum_memory) under user control became common until [virtual memory](/source/virtual_memory) became available in later machines.  Slightly different dialects of Mercury Autocode were implemented for the [Ferranti Atlas](/source/Atlas_Computer_(Manchester)) (distinct from the later [Atlas Autocode](/source/Atlas_Autocode)) and the [ICT 1300](/source/ICT_1301) and [1900](/source/ICT_1900_series) range.

The version for the [EDSAC 2](/source/EDSAC) was devised by [David Hartley](/source/David_Hartley_(computer_scientist)) of  [University of Cambridge Mathematical Laboratory](/source/University_of_Cambridge_Mathematical_Laboratory) in 1961. Known as EDSAC 2 Autocode, it was a straight development from Mercury Autocode adapted for local circumstances, and was noted for its object code optimisation and source-language diagnostics which were advanced for the time. A version was developed for the successor [Titan](/source/Titan_(1963_computer)) (the prototype Atlas 2 computer) as a temporary stop-gap while a more substantially advanced language known as [CPL](/source/CPL_(programming_language)) was being developed. CPL was never completed but did give rise to [BCPL](/source/BCPL) (developed by M. Richards), which in turn led to [B](/source/B_(programming_language)) and ultimately [C](/source/C_(programming_language)). A contemporary but separate thread of development, [Atlas Autocode](/source/Atlas_Autocode) was developed for the University of Manchester [Atlas 1](/source/Atlas_Computer_(Manchester)) machine.

==Other autocodes==
Autocodes developed in the Soviet Union include ''AKI'' (''AvtoKod "Inzhener"'', i.e., "[Engineer autocode](/source/Engineer_autocode)").<ref>[https://chem21.info/page/132204156245074159120102190125178126044016166124/ АвтоКод ИНЖЕНЕР]</ref> and  ''avtokod "Ekonomist"'' ({{lang|ru|автокод ЭКОНОМИСТ}}), used in [Minsk family of computers](/source/Minsk_family_of_computers).<ref>[https://www.computer-museum.ru/articles/materialy-mezhdunarodnoy-konferentsii-sorucom-2020/4125/ Из истории первых белорусских ЭВМ серии «Минск»]</ref>

==References==
{{reflist}}

==Sources==
* {{cite journal |last=Campbell-Kelly|first=Martin|title=Programming the Mark 1: Early Programming Activity at the University of Manchester|journal=Annals of the History of Computing|volume=2|issue=2|publisher=IEEE|year= 1980|pages=130–167 |doi=10.1109/MAHC.1980.10018|s2cid=10845153 }}
* {{cite book |last=Garcia Camarero|first=Ernesto| title= AUTOCODE un sistema simplificado de codificacion para la computadora MERCURY|publisher=Universidad de Buenos Aires| year= 1961| pages= 70| url=http://elgranerocomun.net/AUTOCODE-un-sistema-simplificado.html|language=es}}
* {{cite book |last=London|first=Keith| title= Introduction to Computers| year= 1968| pages= 261}}
* [Knuth, Donald E.](/source/Donald_Knuth); Pardo, Luis Trabb (1976). "Early development of programming languages". Stanford University, Computer Science Department.

==Further reading==
* [http://www.homepages.ed.ac.uk/jwp/history/autocodes/  The Autocodes: a User's Perspective]
*{{cite journal |last1=Brooker |first1=R. A. |title=The Autocode Programs developed for the Manchester University Computers |journal=The Computer Journal |date=1 January 1958 |volume=1 |issue=1 |pages=15–21 |doi=10.1093/comjnl/1.1.15 |language=en |issn=0010-4620|doi-access=free }}
**{{cite journal |last1=Brooker |first1=R. A. |title=Further Autocode Facilities for the Manchester (Mercury) Computer |journal=The Computer Journal |date=1 March 1958 |volume=1 |issue=3 |pages=124–127 |doi=10.1093/comjnl/1.3.124 |language=en |issn=0010-4620|doi-access=free }}
**{{cite journal |last1=Clarke |first1=B. |title=The Pegasus Autocode |journal=The Computer Journal |date=1 April 1959 |volume=1 |issue=4 |pages=192–195 |doi=10.1093/comjnl/1.4.192 |language=en |issn=0010-4620|doi-access=free }}
* {{cite book |author-first1=David William |author-last1=Barron |author-link1=David W. Barron |display-authors=etal |title=Titan Autocode programming manual |publisher=Cambridge, University Mathematical Laboratory |date=1967}}
* {{cite book |author-first=David William |author-last=Barron |author-link=David W. Barron |editor-first=Stanley |editor-last=Gill |editor-link=Stanley Gill |title=Recursive techniques in programming |chapter=1.5. Recursion in Functional Programming |series=Macdonald Computer Monographs |date=1968 |orig-year=1967 |edition=1 |publisher=[Macdonald & Co. (Publishers) Ltd.](/source/Macdonald_%26_Co._(Publishers)_Ltd.) |location=London |sbn=356-02201-3 |page=8}} (viii+64 pages)

Category:History of computing in the United Kingdom
Category:Procedural programming languages
Category:Programming languages created in 1952
Category:Science and technology in Greater Manchester
Category:University of Manchester
Category:University of Cambridge Computer Laboratory

---
Adapted from the Wikipedia article [Autocode](https://en.wikipedia.org/wiki/Autocode) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Autocode?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
