Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
ALGOL W
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Programming language based on a proposal for ALGOL X}} {{Use dmy dates|date=October 2020}} {{Infobox programming language | name = ALGOL W | paradigms = [[Multi-paradigm programming language|Multi-paradigm]]: [[Procedural programming|procedural]], [[Imperative programming|imperative]], [[Structured programming|structured]] | family = [[ALGOL]] | designers = [[Niklaus Wirth]], [[Tony Hoare]] | released = {{Start date and age|1966}} | typing = [[Static type|Static]], [[Strong and weak typing|strong]] | scope = [[Scope (computer science)|Lexical]] | programming language = [[PL360]] | platform = [[IBM System/360]] | operating system = [[OS/360]], [[Michigan Terminal System|MTS]] | license = | file ext = | influenced by = [[ALGOL 60]] | influenced = [[Pascal (programming language)|Pascal]], [[Modula-2]] }} '''ALGOL W''' is a [[programming language]]. It is based on a proposal for [[ALGOL X]] by [[Niklaus Wirth]] and [[Tony Hoare]] as a successor to [[ALGOL 60]]. ALGOL W is a relatively simple upgrade of the original ALGOL 60, adding [[String (computer science)|string]], bitstring, [[complex number]] and [[Reference (computer science)|reference]] to [[Record (computer science)|record]] [[data type]]s and [[Evaluation strategy#Call by copy-restore|call-by-result]] passing of [[Parameter (computer programming)|parameters]], introducing the <code>while</code> statement, replacing <code>switch</code> with the <code>case</code> statement, and generally tightening up the language. Wirth's entry was considered too little of an advance over ALGOL 60, and the more complex entry from [[Adriaan van Wijngaarden]] that would later become [[ALGOL 68]] was selected in a highly contentious meeting. Wirth later published his version as ''A contribution to the development of ALGOL''.<ref name="Wirth">{{cite journal |last1=Wirth |first1=Niklaus |author1-link=Niklaus Wirth |last2=Hoare |first2=C. A. R. |author2-link=Tony Hoare |date=June 1966 |title=A contribution to the development of ALGOL |url=https://dl.acm.org/doi/10.1145/365696.365702 |journal=Communications of the ACM |volume=9 |issue=6 |pages=413–432 |doi=10.1145/365696.365702 |s2cid=11901135 |via=[[Association for Computing Machinery]] |access-date=2020-10-07|doi-access=free }}</ref> With a number of small additions, this eventually became ALGOL W. Wirth supervised a high quality implementation for the [[IBM System/360]] at [[Stanford University]] that was widely distributed.<ref name="Stanford">{{cite report |last1=Bauer |first1=Henry R. |last2=Becker |first2=Sheldon I. |last3=Graham |first3=Susan L. |last4=Forsythe |first4=George E. |last5=Satterthwaite |first5=Edwin H. |date=March 1968 |title=Technical Report Number: CS-TR-68-89 |url=http://www-db.stanford.edu/TR/CS-TR-68-89.html |website=Computer Science Department |publisher=Stanford University}} (Various documents for Stanford's 1972 implementation of ALGOL W; this report includes the ''ALGOL W Language Description''.</ref><ref name="TR71-230">{{cite web |last1=Sites |first1=Richard |title=ALGOL W Reference Manual |url=http://i.stanford.edu/pub/cstr/reports/cs/tr/71/230/CS-TR-71-230.pdf |website=i.stanford.edu |publisher=Stanford University |access-date=24 July 2022}}</ref> The implementation was written in [[PL360]], an ALGOL-like [[assembly language]] designed by Wirth. The implementation includes influential debugging and [[Profiling (computer programming)|profiling]] abilities. ALGOL W served as the basis for the [[Pascal (programming language)|Pascal]] language, and the syntax of ALGOL W will be immediately familiar to anyone with Pascal experience. The key differences are improvements to record handling in Pascal, and, oddly, the loss of ALGOL W's ability to define the length of an array at runtime, which is one of Pascal's most-complained-about features. == Syntax and semantics == ALGOL W's [[Syntax (programming languages)|syntax]] is built on a subset of the [[EBCDIC]] [[character encoding]] set. In [[ALGOL 60]], reserved words are distinct lexical items, but in ALGOL W they are only sequences of characters, and do not need to be [[Stropping (syntax)|stropped]]. Reserved words and identifiers are separated by spaces.<ref name="Stanford"/> In these ways ALGOL W's syntax resembles that of [[Pascal (programming language)|Pascal]] and later languages. The ''ALGOL W Language Description''<ref name="description">{{cite report |last1=Bauer |first1=Henry R. |last2=Becker |first2=Sheldon I. |last3=Graham |first3=Susan L. |last4=Satterthwaite |first4=Edwin H. |last5=Sites |first5=Richard L. |date=June 1972 |title=ALGOL W Language Description |url=https://www.algol60.org/docsW/algolw.pdf}}</ref> defines ALGOL W in an [[affix grammar]] that resembles [[Backus–Naur form]] (BNF). This [[formal grammar]] was a precursor of the [[Van Wijngaarden grammar]].<ref name="Wirth"/><ref>{{cite report |last=van Wijngaarden |first=Adriaan |author1-link=Adriaan van Wijngaarden |date=22 October 1965 |title=Orthogonal Design and Description of a Formal Language: MR76 |url=http://web.eah-jena.de/~kleine/history/languages/VanWijngaarden-MR76.pdf |publisher=Mathematical Centre |place=[[Amsterdam]], Netherlands |via=Ernst-Abbe-Hochschule [[Jena]], University of Applied Sciences, Germany |access-date=2020-10-07 |archive-date=29 October 2019 |archive-url=https://web.archive.org/web/20191029151436/http://web.eah-jena.de/%7Ekleine/history/languages/VanWijngaarden-MR76.pdf |url-status=dead }}</ref> Much of ALGOL W's semantics is defined grammatically:<ref name="description"/> * Identifiers are distinguished by their definition within the current [[Scope (programming)|scope]]. For example, a <code>⟨procedure identifier⟩</code> is an identifier that has been defined by a procedure declaration, a <code>⟨label identifier⟩</code> is an identifier that is being used as a [[goto]] label. * The [[Type system|types]] of [[Variable (computer science)|variables]] and [[Expression (computer science)|expressions]] are represented by affixes. For example <code>⟨τ function identifier⟩</code> is the syntactic entity for a function that returns a value of type <code>τ</code>, if an identifier has been declared as an integer function in the current scope then that is expanded to <code>⟨integer function identifier⟩</code>. * Type errors are grammatical errors. For example, <code>⟨integer expression⟩ / ⟨integer expression⟩</code> and <code>⟨real expression⟩ / ⟨real expression⟩</code> are valid but distinct syntactic entities that represent expressions, but <code>⟨real expression⟩ DIV ⟨integer expression⟩</code> (i.e., integer division performed on a floating-point value) is an invalid syntactic entity. == Example == This demonstrates ALGOL W's [[Record (computer science)|record]] type facility.<ref name="Stanford" /> <syntaxhighlight lang="pascal"> RECORD PERSON ( STRING(20) NAME; INTEGER AGE; LOGICAL MALE; REFERENCE(PERSON) FATHER, MOTHER, YOUNGESTOFFSPRING, ELDERSIBLING ); REFERENCE(PERSON) PROCEDURE YOUNGESTUNCLE (REFERENCE(PERSON) R); BEGIN REFERENCE(PERSON) P, M; P := YOUNGESTOFFSPRING(FATHER(FATHER(R))); WHILE (P ¬= NULL) AND (¬ MALE(P)) OR (P = FATHER(R)) DO P := ELDERSIBLING(P); M := YOUNGESTOFFSPRING(MOTHER(MOTHER(R))); WHILE (M ¬= NULL) AND (¬ MALE(M)) DO M := ELDERSIBLING(M); IF P = NULL THEN M ELSE IF M = NULL THEN P ELSE IF AGE(P) < AGE(M) THEN P ELSE M END </syntaxhighlight> == References == {{Reflist}} == External links == *[https://web.archive.org/web/20100523150449/http://www.jampan.co.nz/~glyn/ aw2c] – ALGOL W compiler for [[Linux]] by Glyn Webster *[https://github.com/glynawe/awe awe] – current version by Glyn Webster *[https://everything2.com/title/Algol+W?searchy=search ALGOL W @ Everything2] – informal but detailed description of the language by a former user, with sidebars extolling ALGOL W over [[Pascal (programming language)|Pascal]] as an [[educational programming language]] *[http://bitsavers.org/pdf/stanford/listing/Algol_W_Listing_Nov69.pdf 1969 ALGOL W compiler listing] at bitsavers.org * The [[Michigan Terminal System]] Manuals, Volume 16: [http://bitsavers.org/pdf/univOfMichigan/mts/volumes/MTSVol16-ALGOLWInMTS-Sep1980.pdf ALGOL W in MTS] *[http://www.algol60.org/15algolwlego.htm ALGOL W materials] More than 200 ALGOL W programs and documentation {{ALGOL programming}} {{Wirth}} {{Authority control}} [[Category:Procedural programming languages]] [[Category:Structured programming languages]] [[Category:ALGOL 60 dialect]] [[Category:Programming languages created in 1966]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:ALGOL programming
(
edit
)
Template:Authority control
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite report
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Wirth
(
edit
)