Talk:ALGOL 68
This is the talk page for discussing improvements to the ALGOL 68 article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
Archives: 1Auto-archiving period: 12 months |
This article is rated B-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||||||||||||||||
|
The funarg problem
[edit]ALGOL 68 supports procedure arguments and return values of arbitrary type, so it would be worthwhile to discuss how it deals with the funarg problem. As far as I recall it really doesn't. Rp (talk) 11:04, 18 October 2013 (UTC)
- While researching support of first-class functions in various languages, I vaguely remember finding the claim that ALGOL 68 supported returning functions, but that an actual implementation would throw a run-time exception if the function was no longer in scope at the point it was invoked. I've never seen an actual ALGOL 68 compiler, so I can't really confirm this, though. —Ruud 14:44, 19 October 2013 (UTC)
- The informal introduction mentions the problem in the definition of event handling procedurers for I/O. A file structure contains pointers to procedures to be called on various error conditions. The problem was that it is pretty difficult to set the handlers for the standard input and standard output files because they had greater scope than user code:
bool badness happened = false; proc handle badness (ref file f) bool : begin badness happened = true; ... return true if problem fixed end; co scope of handle badness is same as scope of badness happened co on value error (standard input, handle badness); co scoping error! co co the previous line is illegal as it does something like: value error of standard input := handle badness; and the scope of handle badness is smaller than the scope of standard input co
- In theory this problem should be detected by the compiler (the program isn't even syntacticaly correct - the Algol68 two-level grammar includes scoping information. In practice I'm not sure. HughesJohn (talk) 17:50, 5 November 2013 (UTC)
Upcoming SyntaxHighlight_GeSHi changes
[edit]¢ A mini wikipedia project for someone? Add Algol68 support on to Pygments?? ¢ http://www.gossamer-threads.com/lists/wiki/wikitech/601327 "Over the course of the next two days, a major update to the SyntaxHighlight_GeSHi extension will be rolled out to Wikimedia wikis ... " "... The languages that will lose support are mostly obscure, with the notable exception of ALGOL68, Oz, and MMIX. ... "
NevilleDNZ (talk) 14:36, 23 June 2015 (UTC)
- Hi NevilleDNZ, and others, as I noted in that thread, it looks like algol support has been added, but that code hasnt been included in a new release yet, and so isnt deployed onto WMF servers. As a result, this page and many others providing sample algol68 code are now appearing in Category:Pages with syntax highlighting errors, such as Printf format string, CLU (programming language), ALGOL 68C, ICL VME, Comparison of ALGOL 68 and C++, Comparison of programming languages (basic instructions), Comparison of programming languages (string functions), Array slicing, Standard streams, Object composition, Conditional (computer programming), Generator (computer programming)#CLU, Interactive ALGOL 68.
- I have been adding mappings from GeSHI langs to 'reasonable' Pygments langs (e.g.) so that bots dont automatically go around the wikis and remove the unsupported langs. In this case, I propose adding a mapping from algol68 to m2. So far, it looks like the m2 lang handler gracefully handles most code chunks using lang=algol68 (testing by previewing with lang=m2), but it fails quite badly on S3 (programming language), so I would appreciate some feedback on whether that is a reasonable mapping before submitting a patch. John Vandenberg (chat) 12:36, 12 July 2015 (UTC)
- There is one more patch needed to make ALGOL support reasonable: https://bitbucket.org/birkenfeld/pygments-main/issues/1093/update-to-m2lexer-and-algol-styles . John Vandenberg (chat) 19:46, 12 December 2015 (UTC)
Bad intro for the layman
[edit]The introductory elements in this article are woefully incomplete. The controversy that prompted the "minority report" is completely absent. There's a timeline of events but no context or explanation of what they mean. There's no discussion of ALGOL 68's adoption in the industry or elsewhere. There's only a 1-sentence allusion to the language's reputation for complexity that ultimately sank it. There are no concrete examples of subsequent languages influenced by ALGOL 68.
--24.212.220.233 (talk) 00:14, 20 July 2015 (UTC)
- Apropos the "minority report", I've just come across [1] which gives quite a lot of interesting detail. I wonder whether there's anything in there which could be usefully worked into the article?
- Also I notice that in the list of minority report signatories that Garwick apparently appears twice, I've not attempted to change this in case there's some good reason. MarkMLl (talk) 22:18, 29 July 2015 (UTC)
- To be honest, I can't see any detail in there about the Algol 68 language itself, which is what this article should focus on if you ask me. Rp (talk) 16:00, 30 July 2015 (UTC)
re: "Garwick apparently appears twice"
- Fixed - NevilleDNZ (talk) 01:33, 27 February 2017 (UTC)
New Computerphile video
[edit]https://www.youtube.com/watch?v=TdzsB-iYj4Y — Preceding unsigned comment added by Codegrinder (talk • contribs) 07:28, 28 September 2020 (UTC)
Program representation, and an explaination of the use of Cascading Style Sheets to achieve the same effect.
[edit]A feature of ALGOL 68, inherited from the ALGOL tradition, is its different representations. There is a representation language used to describe algorithms in printed work, a strict language (rigorously defined in the Report), and an official reference language intended to be used in compiler input. The examples contain bold typeface words, this is the strict language. ALGOL 68's reserved words are effectively in a different namespace from identifiers, and spaces are allowed in identifiers, so this next fragment is legal:
int a real int = 3 ;
Previously similar effect could be achieved with a MediaWiki using a template that imports an Algol_strict Cascading Style Sheet.
eg.
<templatestyles src="Algol_strict/styles.css" />
b {
font-weight: bold!important;
text-transform:lowercase!important;
}
As yet the standard <syntaxhighlight> extension (formerly known as SyntaxHighlight_GeSHi) does not otherwise support Algol 68's formal stropping.
The programmer who writes executable code does not always have an option of bold typeface or underlining in the code as this may depend on hardware and cultural issues. Different methods to denote these identifiers have been devised. This is called a stropping regime. For example, all or some of the following may be available programming representations:
int a real int = 3; # the strict language # 'INT'A REAL INT = 3; # QUOTE stropping style # .INT A REAL INT = 3; # POINT stropping style # INT a real int = 3; # UPPER stropping style # int a_real_int = 3; # RES stropping style, there are 61 accepted reserved words #
All implementations must recognize at least POINT, UPPER and RES inside PRAGMAT sections. Of these, POINT and UPPER stropping are quite common, while RES stropping is a contradiction to the specification (as there are no reserved words). QUOTE (single apostrophe quoting) was the original recommendation, while matched apostrophe quoting, common in ALGOL 60, is not used much in ALGOL 68.[1]
The following characters were recommended for portability, and termed "worthy characters" in the Report on the Standard Hardware Representation of Algol 68 Archived 2014-01-02 at the Wayback Machine:
- ^ Worthy Characters: ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "#$%'()*+,-./:;<=>@[ ]_|
This reflected a problem in the 1960s where some hardware didn't support lower-case, nor some other non-ASCII characters, indeed in the 1973 report it was written: "Four worthy characters — "|", "_", "[", and "]" — are often coded differently, even at installations which nominally use the same character set."
- Base characters: "Worthy characters" are a subset of "base characters".
par: Parallel processing - with BOLD stropping example
[edit]Code appears as BOLDED lowercase, but a physical cut and pastes of code produces uppercase.
ALGOL 68 supports programming of parallel processing. Using the keyword PAR, a collateral clause is converted to a parallel clause, where the synchronisation of actions is controlled using semaphores. In A68G the parallel actions are mapped to threads when available on the hosting operating system. In A68S a different paradigm of parallel processing was implemented (see below).
PROC eat = VOID: ( muffins-:=1; print(("Yum!",new line))), speak = VOID: ( words-:=1; print(("Yuk...",new line))); INT muffins := 4, words := 8; SEMA mouth = LEVEL 1; PAR BEGIN WHILE muffins > 0 DO DOWN mouth; eat; UP mouth OD, WHILE words > 0 DO DOWN mouth; speak; UP mouth OD
END
Example of different program representations
[edit]Representation | Code |
---|---|
Algol68 "strict" as typically published |
¢ underline or bold typeface ¢ mode xint = int; xint sum sq:=0; for i while sum sq≠70×70 do sum sq+:=i↑2 od |
Quote stropping (like wikitext) |
'pr' quote 'pr'
'mode' 'xint' = 'int';
'xint' sum sq:=0;
'for' i 'while'
sum sq≠70×70
'do'
sum sq+:=i↑2
'od'
|
For a 7-bit character code compiler | .PR UPPER .PR
MODE XINT = INT;
XINT sum sq:=0;
FOR i WHILE
sum sq/=70*70
DO
sum sq+:=i**2
OD
|
For a 6-bit character code compiler | .PR POINT .PR
.MODE .XINT = .INT;
.XINT SUM SQ:=0;
.FOR I .WHILE
SUM SQ .NE 70*70
.DO
SUM SQ .PLUSAB I .UP 2
.OD
|
Algol68 using res stropping (reserved word) |
.PR RES .PR
mode .xint = int;
.xint sum sq:=0;
for i while
sum sq≠70×70
do
sum sq+:=i↑2
od
|
ALGOL 68 allows for every natural language to define its own set of keywords Algol-68. As a result, programmers are able to write programs using keywords from their native language. Below is an example of a simple procedure that calculates "the day following", the code is in two languages: English and German.
References
- ^ Revised Report, page 123, footnote
- B-Class Computer science articles
- High-importance Computer science articles
- WikiProject Computer science articles
- B-Class Computing articles
- High-importance Computing articles
- B-Class software articles
- High-importance software articles
- B-Class software articles of High-importance
- All Software articles
- B-Class Early computers articles
- High-importance Early computers articles
- B-Class Early computers articles of High-importance
- All Computing articles