4 ms·
Ask HN: Is it just an accident that Pascal can be compiled extremely fast?
Or was Pascal designed in a way to make this possible?
- bob1029 4y agoTurbo pascal was definitely designed on purpose to make things as fast as possible and undercut all the competition. The compiler for this was ultimately developed by the same guy who architected C#.
- amichail 4y agoTurbo Pascal didn't invent Pascal though.
- musicale 4y agoAs a follow on question: how did fast/responsive (for their time) vintage IDEs like Turbo Pascal and Think C speed up the linking phase?
- miga 4y agoCustom object format: https://prog21.dadgum.com/47.html?repost=true#:~:text=Minimal%20linker.,even%20notice%20it https://prog21.dadgum.com/47.html?repost=true#:~:text=Minima....
- jacobgorm 4y agoIn a previous life, I used to do some fairly heavy drinking with Preben Madsen, who co-founded and was the CEO of PolyData, the Danish company where Anders Heglsberg developed PolyPascal that Borland OEM'ed as Turbo Pascal. According to himself, Preben was the one who convinced Anders Heglsberg to dump Algol for Pascal. They were doing really well with the royalties from Borland, and the highlight of Preben's story is when he went to a Porsche dealer to trade his BMW for a 928 (as I recall). The dealer would not offer him a good enough trade-in price for the BMW, until Preben suggested that he would just buy two Porsches instead of one. I am sure today's crypto-bros can tell even more impressive stories, but for mid-80s Denmark that one was actually quite above average. Unfortunately, the money that PolyData made on Turbo Pascal was all wasted trying to enter the ERP business with a system named Albatross that even IBM viewed as a serious competitor to their IBM Navigator system at one point. However, at years' end reporting, a bug in Albatross would cause all the financial records to get chewed up, which made the system very hard to sell after that. The Albatross disaster caused PolyData to eventually go under, and Heglsberg left PolyData to go work for Borland in the US. After PolyData, Preben started a small PC games distribution company called PolyMedia, and, as I was a (very young man) in the games business in the mid 90s myself, I would always bump into him in London at the bi-annual ECTS computer trade show, where we would go out for dinner and get very drunk, and he would share his many stories of past fame & fortune.
- cassonmars 4y ago> The Albatross disaster caused PolyData to eventually go under, and Heglsberg left PolyData to go work for Borland in the US. Interesting case of nominative determinism
- AnimalMuppet 4y agoPascal - the original Pascal, since in a comment you seem to dislike Turbo Pascal - was designed for a one-pass compiler. Things were laid out to make things very easy for that one-pass compiler - everything defined before its use, no back-tracking necessary. Also the grammar was very simple. And the compiler attempted very few (if any) optimizations compared to current compilers. In short, the language design meant that the compiler didn't have to do much, so what it did, it could do quickly.
- davidhbolton 4y agoI learnt original Pascal at University in 1979 (Queen's University Belfast). It was very spartan compared to what Turbo Pascal would later add. Strings were a type alfa and were ten characters long.
- 082349872349872 4y agoDesigned: industrial programs might be compiled once and run multiple times. Student programs, on the other hand, will likely be run fewer times than they are ever (attempted to be) compiled. Pascal's original use was the latter case.
- Someone 4y agoI don’t think that’s completely true. Pascal was also designed as a general purpose language to compete with Algol and Fortran. See for example Wirth’s https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/68712/eth-3290-01.pdf https://www.research-collection.ethz.ch/bitstream/handle/20....: “Compared to Algol 60, its range of applicability is considerably increased due to a variety of data structuring facilities. In view of its intended usage both as a convenient basis to teach programming and as an efficient tool to write large programs…”
- AnimalMuppet 4y agoMy first reaction was that Pascal's extremely spartan I/O capabilities made that a pipe dream. But then I remembered what Fortran's I/O was like...
- Someone 4y agoYes, the competition wasn’t very strong. You may think Fortran’s I/O was bad, but at least it had I/O, unlike Algol 60 (the standard didn’t define I/O, so every compiler invented its own way of doing I/O)
- Someone 4y agoThe latter. http://pascal.hansotten.com/niklaus-wirth/recollections-about-the-development-of-pascal/ http://pascal.hansotten.com/niklaus-wirth/recollections-abou... “Sophistication in syntax analysis was very much in style in the 1960s, allegedly because of the power and flexibility required to process high-level languages. It occurred to me then that a much simpler and more perspicuous method could well be used, if the syntax of a language was chosen with the process of its analysis in mind. The second attempt at building a compiler therefore began with its formulation in the source language itself, which by that time had evolved into what was published as Pascal in 1970 [Wirth, 1970], The compiler was to be a single-pass system based on the proven top-down, recursive-descent principle for syntax analysis.”
- throwaway81523 4y agoNo, not an accident. This article is about Turbo Pascal but discusses some of the topic: https://prog21.dadgum.com/47.html https://prog21.dadgum.com/47.html
- andrewgilmartin 4y agoIt also stopped at the first compilation error. You didn’t mind as it placed the cursor at the error in the editor and a recompile was a keypress away.