4 ms·
You are looking at the original Pascal from a modern perspective. At its time it was very nice which is why it exploded in popularity. When Pascal was designed
by badsectoracula 6y ago
You are looking at the original Pascal from a modern perspective. At its time it was very nice which is why it exploded in popularity.
When Pascal was designed there wasn't an idea of a 'file' like what you have today - files often had their own data types and were series of defined records and different systems had different ideas of their structure. AFAIK in original Pascal you were supposed to pass any files as part of the program's environments and you declared as part of the program itself (`program Foo(a,b)`) these files - it was up to the system to provide those (Turbo Pascal ignored those).
The other stuff you mention about extern, include, etc follow from that. Many systems didn't think of files like Unix where they were just series of bytes.
The bits about default, continue, break, etc were intentional as having a structure in the program's flow was a big thing at the time and those would be seen like hidden gotos (the addition of 'goto' was probably seen a necessary evil for its time - but even then you had to explicitly declare the targets).
- guidoism 6y agoAnd Pascal was basically just an improved ALGOL which in part was designed to come up with a common notation to communicate algorithms in journal articles. The negative issues aren’t so bad in that light.
- drfuchs 6y agoNo, I’m looking at Pascal from a 1978 perspective. If there had been a good C compiler for the PDP10, TeX would not have been written in, actually, a macro language on top of Pascal (to help work around its shortcomings both in string handling and memory management; oh and that statement labels have to be numeric).
- vidarh 6y agoFrom a 1978 perspective, Pascal was indeed already becoming dated, sure. But by then Wirth had already developed Modula, and started Modula 2. But even from a 1978 perspective, most of your criticism of Pascal is for being bad at things it was never designed to be good at, and never pretended to be good at. It was a teaching language trimmed down (in terms of concepts) from Algol W for ease of implementation over feature-completeness, not designed to be a systems language. That it became the basis for so many language implementations that opted to solve the limitations of Pascal over starting from scratch is a testament to its success.
- AnimalMuppet 6y agoBut at the time, it was claimed that it was a systems language! No less than C. A. R. Hoare claimed in 1977 that it was "the best language in the public domain for purposes of system programming and software implementation." Source: Reference 18 of "Why Pascal is Not My Favorite Programming Language" (http://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pascal.html http://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pasc...). Having had to use a "Pascal as defined by Wirth", by the way, everything in that criticism is dead on. Almost every one was an actual pain point for me when trying to write actual programs. (Not xor, but just about everything else.)
- vidarh 6y agoHoare may have claimed that, but Wirth did not to my knowledge, and judging Pascal by the standards of praise given by someone who didn't design it is a bit weird. (It's also worth considering that Hoare did posit e.g variants of Pascal, and it's unclear if he was writing of unextended Pascal, or in the abstract.or about a variant) I don't think the criticism is wrong with the caveats Kernighan gave, because he went to lengths to address its use outside of the educational domain it was designed for. Just not very relevant unless you happen to be dealing with the truly rare persons that were promoting an unextended Pascal as a systems language by 1981.
- AnimalMuppet 6y agoI am that rare person. I was using it as a systems language in 1986. Without the Turbo extensions. (We did have separate compilation.) Why yes, I am still bitter, does it show?
- vidarh 6y agoIf you had separate compilation you were not using unextended Pascal. And it does not sound like you thought it was suitable, so you don't seem to fit the description? Who in the world pushed a limited Pascal on you that late? It does seem like something Wirth himself would have seen as an awful decision given that he'd worked on replacements for Pascal for a decade at that point, and wrapped up his work on Modula-2 to move on to Oberon.
- billfruit 6y agoPerhaps you should compare Pascal with BASIC than C, I do think Pascal comes out better in that comparison.
- bitwize 6y ago> You are looking at the original Pascal from a modern perspective. "Modern" as in 1981? http://www.lysator.liu.se/c/bwk-on-pascal.html http://www.lysator.liu.se/c/bwk-on-pascal.html
- vidarh 6y agoBy 1981, Wirth had long since moved on - Pascal was superseded by both Modula ('73-'76) and Modula-2 (first compiler released '79) in terms of Wirth's own efforts by then. So, sure, already by 1981, the original Pascal was already old, and Pascal as a class of languages was still on a growth trajectory not because of "pure" Pascal, but because it was a very simple base to build something more advanced on top of. You'll note that Kernighan very specifically recognises and addresses the distinction between the purpose of Pascal as a teaching language vs. his criticism of it for "writing real programs". That was somewhat relevant at the time exactly because a lot of people were using Pascal to "write real programs" and opted to extend Pascal rather than use more advanced languages as their basis. But it was of a lot less relevance with respect to the origins and purpose of Pascal. Many of the lessons Kernighan describes are lessons Wirth was aware of as well, in designing Modula, Modula-2, and the various versions of Oberon. Though his approach was always to look for ways of solving these issues through careful simplification over ever more complex languages. By 1981, when considering writing "real programs" for production use, Kernighan gave valid criticism. In 1970, when considering Pascal's aim as a tool to teach structured programming, it would not have been. So, yes, "modern", even then.
- sitkack 6y agoConjecture, both patterns you outline are the same phenomena, and stem from Pascal being a wonderful Algol canvas to create new languages from. That Pascal was the LLVM of its day but with an added benefit that because of its simplicity, it could spread as a pure idea, being able to implement from a single mind, means that it would be used as the basis for language and system design. The only way it could be more useful is if Wirth had spec'd a stable s-expr syntax as well.
- 6y ago