30 ms·
Wow, that is incredibly damning. Is it actually true that arrays of different lengths are different types, and there is no way to write generic array methods? A
by kortex 5y ago
Wow, that is incredibly damning. Is it actually true that arrays of different lengths are different types, and there is no way to write generic array methods? And there's no way to cast byte arrays into structures? I almost can't believe it - a language without both features, and without any kind of escape hatche to me feels forever bound to be a toy language. But that would absolutely answer OP's question - it never took off cause IO is completely hamstrung. Programs need IO, and lots of it, with lots of flexibility, to do anything interesting.
Edit: I said I was a bit incredulous of the claims. If true, those would be bad features.
- pjmlp 5y agoOnly if one only looks to the original Pascal language as means to sell their propaganda. All Pascal dialects, and the Extended Pascal standard that improved the original one, had the array of <type> construct that allows you to query for the actual bounds. Type conversations were also available, again in all dialects. Naturally, those variants were ignored, as Kernighan had a message to sell.
- kortex 5y agoThanks for clearing that up
- pjmlp 5y agoHere is Object Pascal for Mac OS, https://www.folklore.org/StoryView.py?project=Macintosh&story=3rd_Party_Developers_and_Macintosh_Development.txt https://www.folklore.org/StoryView.py?project=Macintosh&stor... http://preserve.mactech.com/articles/mactech/Vol.02/02.12/ObjectPascal/index.html http://preserve.mactech.com/articles/mactech/Vol.02/02.12/Ob...
- Turing_Machine 5y ago> Naturally, those variants were ignored, as Kernighan had a message to sell. Those variants were "ignored" because they largely didn't exist. Kernighan's essay was written in 1981. The first release of Turbo Pascal wasn't until 1983. The Extended Pascal standard wasn't released until 1990.
- pjmlp 5y agoUCSD Pascal in 1977, Concurrent Pascal in 1974, DEC Pascal in 1981, and you can follow up in another dates here, http://pascal.hansotten.com/ http://pascal.hansotten.com/ And then there is the detail that Modula-2 was released in 1978, exactly with the goal to fix all original Pascal issues for systems programming.
- throwaway81523 5y agoModula-2 was at best obscure at the time, while Pascal was popular. Kernighan got involved with Pascal in order to write the Pascal version of "Software Tools", called Software Tools in Pascal. He wrote "Why Pascal is not my favorite PL" as a result of that book effort. I believe that is explained in the article. If there had been enough demand to also do a Modula version of the book, he might have written a more favorable article about Modula afterwards.
- pjmlp 5y agoObscure, when the book was published three years earlier. And based on Mesa, used at Xerox PARC. Then again, ignoring systems languages outside Bell Labs seemed to have been a thing back in the day.
- throwaway81523 5y agoYou are missing that Software Tools was written for a popular audience, more or less. The Pascal edition was written because people were using Pascal and wanted it. Nobody was asking for a Modula-2 edition.
- Tozen 5y agoThis is not true, many variants of Pascal existed, prior to Kernighan's essay. Significant ones like Apple Pascal (1979) or DEC's VAX-11 Pascal (1979). https://vintageapple.org/apple_ii/pdf/Apple_Pascal_1980.pdf https://vintageapple.org/apple_ii/pdf/Apple_Pascal_1980.pdf http://www.bitsavers.org/pdf/dec/vax/lang/pascal/AA-H485A-TE_VAX-11_PASCAL_V1.0_Users_Guide_Nov79.pdf http://www.bitsavers.org/pdf/dec/vax/lang/pascal/AA-H485A-TE... Look in the acknowledgement section of his essay, and no clarification is given to the extent of research on other variants of Pascal outside of the original Pascal of 1973, and references to documents such as "An Assessment of the Programming Language Pascal" of 1975, and "Pascal User Manual and Report" of 1978. Those documents were ISO/IEEE related, to help promote an ISO standard of Pascal, versus businesses using Pascal in the commercial space like Apple and DEC (later Compaq) were doing (both major companies). Further damning of the type of assessment that Kernighan was engaging in, was him referencing other AT&T Bell Lab comparisons between C and Pascal. AT&T is not an innocent 3rd party, but where C and C++ were created and having a huge interest in pushing those languages, along with Unix in business and universities (which they did). Kernighan's essay (on 1970s era Pascal), should have been seen as biased and influenced by or promoting the commercial interests of AT&T (promoting their C and Unix). It should not have been taken seriously by anyone beyond 1989, where Pascal became Object Pascal. Apple created Object Pascal in 1986 (in consultation with Niklaus Wirth), and then Borland added Object Pascal extensions to the very successful Turbo Pascal 5.5 (allowing it to do OOP too). Nearly everything in his paper was clearly and already addressed by 1989 and even various ones when he published it in 1981. Kernighan also had plenty of time to retract or update the statements he made in his "hit piece" paper, to reflect on the ISO 1990 Pascal or the commercially used variants of Pascal such as Object Pascal. Yet, he never did so. Comparatively, it's not like C or C++ stayed the same language as it was in the 1970s, so it shouldn't be expected that Pascal is suppose to not change.
- AnimalMuppet 5y agoKernighan wrote that in 1981. As late as 1988, I was (unwillingly) using an original, non-extended Pascal. Those were still out there, still being used. And, all Pascal dialects had some construct. They had different constructs. If you wanted to be portable, you couldn't use any of them (until the Extended standard came out). Kernighan notes those extensions, but does not accept them as a solution because of their non-portability. You may think that he is more dismissive than he should be here, but at that time, C was considerably better on code portability. And when you say that Kernighan was acting as a propagandist, I wonder whether you are being one. You certainly seem to have a message to sell when it comes to Pascal vs C...
- pjmlp 5y agoSo apparently ignoring that C was subject to the same dialects problems outside UNIX doesn't count. Nor that Modula-2, designed to fix all those issues with ISO Pascal, was in use since 1978. Yeah, whatever.
- AnimalMuppet 5y agoPretty sure you could allocate a variable-length array in C without tripping on dialect issues, in or out of Unix. It may have had such issues, but they were much less fundamental than in Pascal.
- ncmncm 5y agoVarious C implementations had extensions, but you rarely needed to depend on any of them to do useful work. All the UNIX utilities were written without using any. Implementations for x86 had a mess of different pointer types, but to build the same program for a non-crippled CPU you could #define the extra keywords to the empty string.
- AnimalMuppet 5y agoLate addendum, just in case anybody reads this: Kernighan wrote that paper after writing "Software Tools In Pascal", and finding it considerably harder than it should have been to write that kind of thing in Pascal. (The predecessor book, "Software Tools", was written in RATFOR, and Pascal should have been miles better to write software in.) In this book, they (Kernighan and Plaugher) tried to write code that would work in Pascal, not just in one dialect of it. That is, portability was essential to the code they were writing for the book. That may have lead to a greater emphasis on portability in Kernighan's paper than one might think warranted by the general situation.