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
COMAL
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|Computer programming language}} {{Infobox programming language | paradigm = [[structured programming|Structured]] | year = 1975 | designer = Børge R. Christensen, Benedict Løfstedt | developer = | latest release version = | latest release date = | typing = [[Strong and weak typing|Strong]] | implementations = | dialects = | influenced_by = [[BASIC]], [[Pascal (programming language)|Pascal]] | influenced = }} '''COMAL''' (''Common Algorithmic Language'') is a computer [[programming language]] developed in [[Denmark]] by Børge R. Christensen and Benedict Løfstedt and originally released in 1975. It was based on the [[BASIC]] [[programming language]], adding multi-line statements and well-defined [[subroutine]]s among other additions. COMAL was originally written for [[minicomputer]]s, but was small enough to run on early [[microcomputer]]s as well. It is one of the few [[structured programming]] languages that were available for and comfortably usable on [[8-bit]] [[home computer]]s. "COMAL Kernel Syntax & Semantics" contains the formal definition of the language.<ref name="COMAL Kernel Syntax & Semantics"/> Further extensions are common to many implementations.<ref name="Common COMAL Definition and Tests"/><ref name="Compatible keywords"/><ref name="Keyword syntax and examples"/> == History == ===Minicomputer versions=== COMAL was originally developed in [[Denmark]] by mathematics teacher Børge R. Christensen. The school in which he taught had received a [[Data General Nova]] 1200 minicomputer in 1972, with the expectation that the school would begin to teach [[computer science]]. Christensen, who had taken a short course on the subject at university, was expected to lead the program and to maintain the computer system.{{sfn|Christensen|1985|p=1}} The NOVA was supplied with [[Data General Extended BASIC]], and Christensen quickly became frustrated with the way in which the unstructured language led students to write low-quality code that was difficult to read and thus mark.{{sfn|Christensen|1985|p=1}} While complaining about these problems to computer scientist Benedict Løfstedt, Løfstedt encouraged Christensen to read ''[[Systematic Programming]]'', the then-new book on programming language design by [[Niklaus Wirth]], the creator of [[Pascal (programming language)|Pascal]]. Christensen was impressed, but found that he could not use Pascal directly, as it lacked the interactive [[shell (computing)|shell]] that made BASIC so easy for students to develop with.{{sfn|Christensen|1985|p=2}} Over the next six months Christensen and Løfstedt corresponded by mail to design an alternative to BASIC which retained its interactive elements but added structured elements from Pascal.{{sfn|Christensen|1985|p=2}} By 1974, the language's definition was complete but Christensen was unsuccessful in attracting interest from software firms in developing an implementation. Over the next six months he worked with two of his students, to whom he had taught NOVA 1200 [[machine language]], to write an implementation themselves. One of the first things added was the ability to use eight-character variable names, up from the typical one or two.{{sfn|Christensen|1985|p=2}} Later additions in the first version included multi-line {{code|IF...THEN...ELSE...ENDIF|comal}} statements, and the {{code|PROC...ENDPROC|comal}} definitions and the {{code|EXECUTE}} statement to call them.{{sfn|Christensen|1985|p=4}} The first proof-of-concept implementation (running a five-line loop) was ready on 5 August 1974, and the first release (on [[punched tape|paper tape]]) was ready in February 1975. Development costs had been around {{USD|300}}. Only now did the system (which had previously used an internal Danish name) pick up the name ''COMAL'', for ''Common Algorithmic Language'', inspired by [[ALGOL]], with which Christensen had been experimenting.{{sfn|Christensen|1985|p=4}} The first release was therefore named ''COMAL 75''. Christensen subsequently wrote a textbook on the language which evolved into ''Beginning COMAL''.<ref name="The Story of COMAL" /> ===Microcomputer versions=== In 1978, Christensen began to adapt COMAL such that it would run on [[microcomputer]]s, which were becoming available. He was worried that without such an implementation he would be required to teach and use BASIC again as Danish schools acquired the new machines. By 1980, a version of COMAL developed in conjunction with a college group was able to run on the [[Zilog Z80]], and thus ''COMAL 80'' was released.{{sfn|Christensen|1985|p=4}} Around the same time, a Danish firm introduced the [[Comet (computer)|Comet]], a very capable microcomputer for the time, which would be the first machine to run a version of what would look like the later COMAL releases. Christensen subsequently stepped back from COMAL development around 1980-81, which was handed over to groups including UniComal,<ref name="UniComal 3.11 IBM PC" /> started by Mogens Kjaer, who had written to Christensen with critiques of COMAL and subsequently [[porting|ported]] it to the [[Commodore PET]] for release 0.14. At this time, Danish schools insisted that COMAL be available on any microcomputer they purchased.<ref name="The Story of COMAL" /> In the early 1980s, [[Apple Inc.|Apple Computer]] won a contract to supply [[Apple II]] computers running [[CP/M]] and COMAL to Irish secondary schools.<ref name="Moynihan"/> It was popular for education<ref name="Brady"/> and some textbooks were locally written.<ref name="Kelly"/><ref name="LundyOSullivan1990"/> In 1984, [[Acornsoft]] released a COMAL implementation, by David Christensen, Jim Warwick and David Evers, for their 8-bit [[BBC Micro]] and [[Acorn Electron]] computers (with a manual by Paul Christensen and Roy Thornton<ref name="Thornton"/>) Between 1984-1987, [[TeleNova]], a subsidiary of the industrial arm of the Swedish Telecoms system, manufactured a [[desktop PC]] called "[[Compis]]" for the educational sector. An enhanced version of COMAL was supplied as the standard programming language for this PC. Versions were created for both [[CP/M-86]] and [[MS-DOS]]. The latter version is available for [[Windows XP]]. The (Swedish) reference manual is {{ISBN|91-24-40022-X}}. In 1990, Thomas Lundy and Rory O'Sullivan produced the definitive text on COMAL Programming.<ref name="LundyOSullivan1990" /> They matched and compared COMAL with [[BBC BASIC|BBC Structured Basic]]. As of 2016, COMAL is still actively in use as an educational programming language. Some high schools in the United Kingdom continue to use it to teach the subject of computing.<ref>{{cite web |last1=Laine |first1=Heather |title=Gracemount High School |url=https://livecode.com/gracemount-high-school/ |website=LiveCode |access-date=29 March 2024 |archive-url=https://web.archive.org/web/20240329213122/https://livecode.com/gracemount-high-school/ |archive-date=29 March 2024 |date=12 February 2015 |url-status=live}}</ref> == Description == COMAL was created as a mixture of the prevalent educational programming languages of the time, [[BASIC]], [[Pascal (programming language)|Pascal]], and, at least in the [[Commodore International|Commodore]] and [[Compis]] versions, the [[turtle graphics]] of [[Logo (programming language)|Logo]]. The language was meant to introduce [[structured programming]] elements in an environment where BASIC would normally be used. In early versions, the primary additions to the language were block versions of IF...THEN, and the PROC construct. In most previous versions of BASIC, the only block construct was the FOR...NEXT loop. For instance: <syntaxhighlight lang="comal"> 10 FOR I=1 TO 10 20 PRINT I 30 J=J+1 40 NEXT I </syntaxhighlight> This example performs a loop ten times, and performs two instructions every time through the loop. In contrast, almost every other instruction in BASIC, or ''statement'', has to be accomplished on a single line. This can make multi-line statements difficult to perform on an all-or-nothing basis. For instance, if a program desires to run three instructions if a particular value is greater than 10, the typical solution is: <syntaxhighlight lang="comal"> 10 IF A<=10 THEN 50 20 PRINT "A IS GREATER THAN 10" 30 A=A+10 40 PRINT "A IS NOW ";A 50 PRINT "RETURNING TO OUR REGULARLY SCHEDULED PROGRAMMING" </syntaxhighlight> This sort of construct hides the true intention of the program, the decision is based on the opposite logic of what the programmer actually wants to accomplish. Additionally, to understand what will happen in this case, the reader has to find line 50, which in real programs might be much further into the [[source code]]. This is one of the major reasons that BASIC programs are referred to as "[[spaghetti code]]", as to follow the logic one moves around the program as if following a series of random spaghetti noodles. COMAL addresses this issue through the use of blocks. To accomplish this same series of instructions, in COMAL one would write: <syntaxhighlight lang="comal"> 10 IF A>10 THEN 20 PRINT "A IS GREATER THAN 10" 30 A=A+10 40 PRINT "A IS NOW ";A 50 ENDIF 60 PRINT "RETURNING TO OUR REGULARLY SCHEDULED PROGRAMMING" </syntaxhighlight> In this case, the author writes the decision they are actually trying to accomplish, and the reader can follow the logic simply by looking for the {{code|ENDIF}}. This is aided by COMAL's use of leading spaces to visually indicate blocks. == Examples == * "Hello, world!" *:<syntaxhighlight lang="comal"> PRINT "HELLO, WORLD!" </syntaxhighlight> * Conditions *:<syntaxhighlight lang="comal"> IF condition THEN instructions ENDIF </syntaxhighlight> * Loops *:<syntaxhighlight lang="comal"> FOR number:= 1 TO 1000 DO PRINT number ENDFOR </syntaxhighlight> * Print statements with variables *:<syntaxhighlight lang="comal"> INPUT "What's your favourite number? " :nmr# PAGE PRINT "Your favourite number is " ; nmr# </syntaxhighlight> == Availability == COMAL was available for: * [[BBC Micro]] * [[Commodore PET]] * [[Commodore 64]] * [[Commodore 128]] * [[Amiga]] * [[Compis]]/[[Scandis]] * [[CP/M]] * [[IBM Personal Computer|IBM PC]]<ref name="UniComal 3.11 IBM PC" /> * [[Tiki 100]] * [[ZX Spectrum]] * [[Grundy NewBrain]] * [[Windows XP]] == See also == * [[Action! (programming language)]] == References == {{Reflist|refs= <ref name="The Story of COMAL">{{cite journal |last1=Christensen|first1=Børge |title=The Story of COMAL |journal=COMAL Today |date=March 1985 |issue=25 |pages=1–10 |url=https://archive.org/download/COMAL_Today_Issue_25 |access-date=4 September 2020 }}</ref> <ref name="COMAL Kernel Syntax & Semantics">{{cite web|last1=Ryan|first1=Kevin|title=COMAL Kernel Syntax & Semantics|url=http://datamuseum.dk/w/images/d/d5/KR_COMAL80_Kernel_Syntax_and_Semantics_Apr_1985.pdf|publisher=Dansk Datahistorisk Forening|access-date=8 November 2017}}</ref> <ref name="Common COMAL Definition and Tests">{{cite journal|last1=Bain|first1=Richard|last2=Lindsay|first2=Len|title=Common COMAL Definition and Tests|journal=COMAL Today|issue=24|pages=21–46|url=https://archive.org/download/COMAL_Today_Issue_24|access-date=20 January 2020}}</ref> <ref name="Compatible keywords">{{cite journal|title=Common COMAL -- Compatible keywords|journal=COMAL Today|issue=25|pages=28|url=https://archive.org/download/COMAL_Today_Issue_25|access-date=20 January 2020}}</ref> <ref name="Keyword syntax and examples">{{cite journal|title=Common COMAL -- Keyword syntax and examples|journal=COMAL Today|issue=25|pages=29–33|url=https://archive.org/download/COMAL_Today_Issue_25|access-date=20 January 2020}}</ref> <ref name="Moynihan">{{cite journal|last1=Moynihan|first1=Michael D.|title=COMAL coverage out of Ireland|journal=InfoWorld|date=8 August 1983|volume=5|issue=32|page=30|url=https://archive.org/stream/Infoworld-1983-08-08/#page/n31/mode/2up|access-date=15 November 2017}}</ref> <ref name="Brady">{{cite thesis|last1=Brady|first1=Michael P.|title=The Design of a First Course in Programming|date=May 1986|publisher=Loughborough University of Technology|location=Loughborough, Leicester, UK|hdl=2134/10392|url=https://dspace.lboro.ac.uk/dspace-jspui/handle/2134/10392|access-date=15 November 2017|type=thesis}}</ref> <ref name="Kelly">{{cite book|last1=Kelly|first1=John|title=Foundations in Computer Studies with COMAL|date=1984|publisher=The Educational Company|location=Dublin, Ireland|edition=Second|url=https://archive.org/details/foundations-in-computer-studies-with-comal_2nd-ed-1984|access-date=20 January 2020}}</ref> <ref name="LundyOSullivan1990">{{cite book|last1=Lundy|first1=Thomas|last2=O'Sullivan|first2=Rory|title=Beginning structured programming in BASIC and COMAL|date=1990|publisher=Gill and Macmillan|location=Dublin, Ireland|isbn=978-0717116676}}</ref> <ref name="Thornton">{{cite book|last1=Thornton|first1=Roy|last2=Christensen|first2=Paul|title=COMAL on the BBC Microcomputer and Acorn Electron SBD 19|date=1984|publisher=Acornsoft|isbn=978-0907876908}}</ref> <ref name="UniComal 3.11 IBM PC">{{cite web|title=UniComal 3.11 IBM PC|date=January 1992|url=https://archive.org/details/uni-comal-3.11-16bitwindos-os-2|publisher=Internet Archive|access-date=1 April 2021}}</ref>}} == Further reading == * Thomas Lundy & Rory O'Sullivan: ''Beginning Structured Programming in BASIC and COMAL'', 1990 * Roy Atherton: ''Structured programming with COMAL.'' Horwood, Chichester 1982, {{ISBN|0-85312-416-7}}. * {{cite journal|last=Bramer|first=M. A.|title=COMAL 80—Adding structure to BASIC|journal=Computers & Education|volume=6|issue=2|year=1982|pages=179–192|issn=0360-1315|doi=10.1016/0360-1315(82)90031-8}} * Børge R. Christensen: ''Beginning Comal.'' Horwood, Chichester 1982, {{ISBN|0-85312-435-3}}. * Børge R. Christensen: ''[https://archive.org/details/COMAL_Reference_Guide COMAL Reference Guide].'' Toronto PET Users Group, Toronto Ontario, {{ISBN|0-920607-00-4}}. * {{cite journal|last=Leuschner|first=Burkhard|title=Comal's the thing|journal=System|volume=15|issue=3|year=1987|pages=373–376|issn=0346-251X|doi=10.1016/0346-251X(87)90011-X}} * Len Lindsay: ''[https://archive.org/details/COMAL_Handbook_1983_Reston_Publishing COMAL handbook].'' Reston Publishing, Reston, VA, 1983, {{ISBN|0-8359-0878-X}}. * Gordon Shigley: ''[https://archive.org/details/The_Amazing_Adventures_of_Captain_Comal_Book_6 COMAL Workbook].'' Comal Users Group, USA, 1985, {{ISBN|0-928411-05-2}}. == External links == * [http://www.josvisser.nl/opencomal/ OpenCOMAL] for [[Unix]], [[MS-DOS]] and [[Win32]] * [https://github.com/poldy/OpenCOMAL A fork of the above] for standards-compliant [[Unix]], mainly [[Linux]] and [[Mac OS X]] * [https://archive.org/details/uni-comal-3.11-16bitwindos-os-2 UniComal 3.11] packaged to run under [[DOSBox]] * [http://www.atarimagazines.com/compute/issue54/132_1_Update_On_COMAL_A_SuperBASIC.php Description of COMAL, versions, and characteristics] (1984) {{Authority control}} [[Category:Programming languages]] [[Category:Educational programming languages]] [[Category:Structured programming languages]] [[Category:Procedural programming languages]] [[Category:Programming languages created in 1973]] [[Category:BASIC programming language family]]
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:Authority control
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:ISBN
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Reflist
(
edit
)
Template:Sfn
(
edit
)
Template:Short description
(
edit
)
Template:USD
(
edit
)