Article View: comp.arch
Article #144Re: Comment delimiters
From: Thomas Koenig
Date: Fri, 16 Oct 2026 06:35
Date: Fri, 16 Oct 2026 06:35
67 lines
4647 bytes
4647 bytes
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb: > EricP <ThatWouldBeTelling@thevillage.com> writes: >>Old FORTRAN is difficult to parse because >>a) it did not separate the language into lexical and syntax levels >>b) it was white space oblivious except in quoted strings >>c) there were no reserved words - keywords were statement >> position and sometimes semantic context dependent. >>d) statements were based on punch cards BUT because >> continuation cards used the absence of a C in column 6 >> to indicate the start of a new statement, parsers have to >> always look ahead to see in the next card has a C and >> then "unget" the card if not. > > Given that the original FORTRAN worked on an IBM 704, I think that the > designers made it as easy (and with as little memory) to parse as they > could, given the state of the art at the time. Concerning the points: > > a) I guess that the division into lexical and syntax levels had not > been developed at the time; They did not even have recursive descent parsing, and nobody had parsed formulas with operator precedence before. See https://en.wikipedia.org/wiki/Operator-precedence_parser#Full_parenthesization . > and even later, e.g., Wirth does not > make this distinction in his language definitions, using EBNF down > to the lexical level (although he does define reserved words). Also in modern language definition. Separating lexing and parsing is a matter of convenience, especially since regular expressions have been introduced, and speed. > b) Without this distinction, if you ignore white space at all, you > either ignore it everywhere, or give it a special role in your > syntax. Ignoring is probably simpler. The added complication of separate handling of whitespace is minor. For the original FORTRAN, they skipped them because card punch operators often made mistakes with spaces. > c) The programming language community took quite a while until it > arrived at reserved words. Reserved words make the compiler writer's job easier (somewhat, but not tremendously), but not having them is a solved problem. Users are left holding the bag if a new version of the language introduces new keywords. Same with intrinsics (or standard functions, or whatever...) if a new version of the language introduces new ones, users can run into problems. >E.g., while Algol 60 was specified in > BNF, being modern in that regard, it does not have reserved words, > just symbols that are distinct from all identifiers; i.e., you > could have an identifier like IF in Algol 60, distinct from the > symbol 'IF', and it's up to the implementation how to distinguish > them. Anyway, without a) reserved words make no sense. > > d) Does the original FORTRAN support continuation cards? Yes, it would have extremely restricted otherwise. -- This USENET posting was made without artificial intelligence, artificial impertinence, artificial arrogance, artificial stupidity, artificial flavorings or artificial colorants.
Technical Details
Message-ID:
<11asgjl$328d5$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<1791742457-5857@newsgrouper.org> <11agm4p$2tfut$1@dont-email.me> <11ahs8q$38ir0$4@dont-email.me> <11aig3c$3hdcn$1@dont-email.me> <11aiqc0$3kr94$3@dont-email.me> <179190779286.25645.14465927900754526737@media.vsta.org> <179190779286.25645.14465927900754526737@media.vsta.org> <vandys@vsta.org> <jwvjynl2cg0.fsf-monnier+comp.arch@gnu.org> <808vclt9i2mso89n1itvnvos5j88g1mopl@4ax.com> <6acfc2b2.1547984@news.eternal-september.org> <HZQzS.6$TYg.3@fx21.iad> <2026Oct15.081750@mips.complang.tuwien.ac.at>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Thomas Koenig <tkoenig@netcologne.de> Newsgroups: comp.arch Subject: Re: Comment delimiters Date: Fri, 16 Oct 2026 06:35:33 -0000 (UTC) Organization: A noiseless patient Spider Lines: 67 Message-ID: <11asgjl$328d5$1@dont-email.me> References: <1791742457-5857@newsgrouper.org> <11agm4p$2tfut$1@dont-email.me> <11ahs8q$38ir0$4@dont-email.me> <11aig3c$3hdcn$1@dont-email.me> <11aiqc0$3kr94$3@dont-email.me> <179190779286.25645.14465927900754526737@media.vsta.org> <179190779286.25645.14465927900754526737@media.vsta.org> <vandys@vsta.org> <jwvjynl2cg0.fsf-monnier+comp.arch@gnu.org> <808vclt9i2mso89n1itvnvos5j88g1mopl@4ax.com> <6acfc2b2.1547984@news.eternal-september.org> <HZQzS.6$TYg.3@fx21.iad> <2026Oct15.081750@mips.complang.tuwien.ac.at> Injection-Date: Fri, 16 Oct 2026 06:35:33 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3219877"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8lK80WnZyCL5CPhA4ZVibH5i8bldz36o="; posting-host="44d8092fd0bdd5dfecb423d6f755c59c" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:uJiS9W3lpQtzUkn9n9zwwPCcETY= sha256:MSymWZKngaeQmcCVvV2AJ2laCD365zntUnOv7J/J0Zo= sha1:2NywT3YjShSptTHbvuLH8us3MUQ= sha256:lG+l8XZYxMTW1eE8O941EvWDAJQFs/jgUW4dnicHLGc=