News for hackers. Stuff that matters.
Re:Turbo Pascal Turns 40 by rezaprima on Thursday November 30, 2023 @04:35PM (#38479520)
25 seconds to compile it? How come ?
Re:Turbo Pascal Turns 40 by qznc on Thursday November 30, 2023 @05:05PM (#38479856)
Niklaus Wirth (Pascal inventor) had the rule that compiler speed must never regress. So if you add an optimization (which means the compiler has to do more work), the optimization must "pay for itself" and make the compiler faster.

That philosophy probably seeped into Turbo Pascal to some degree.

Re:Turbo Pascal Turns 40 by kant2002 on Thursday November 30, 2023 @09:45PM (#38482401)
That’s very interesting. I see similar attitude in the C# JIT/Roslyn developers where they take this very seriously. Interesting are this is influenced by Anders, or just whole thing tick for a lot of compiler developers?
Re:Turbo Pascal Turns 40 by cxr on Friday December 01, 2023 @06:56AM (#38485776)
You're saying that the reason for the slow compilation speed we see here is a commitment to keeping the compiler fast. That's not a logical sequence of thought.
Re:Turbo Pascal Turns 40 by stg22 on Thursday November 30, 2023 @06:24PM (#38480707)
Also, Pascal is a direct descendant of a very, very old language (ALGOL-58 from 1958). In the 1950s, HLL compilation was at the extreme edge of what computers were capable of doing and a key goal of language design was (or should have been - cough COBOL cough) to make it as efficient as possible.

By the time Ken Thompson was designing languages, hardware had improved a lot and he could make compilation efficiency a lower priority.

Re:Turbo Pascal Turns 40 by timbit42 on Friday December 01, 2023 @04:42PM (#38492868)
Technically, ALGOL-58 lead to ALGOL-60 which led to ALGOL X (1966) then to ALGOL W (1966) and then to Pascal (1970). X and W were proposals by Nicklaus Wirth and Tony Hoare as successors to ALGOL 60.
Re:Turbo Pascal Turns 40 by giancarlostoro on Thursday November 30, 2023 @04:37PM (#38479550)
My understanding is the compiler was insanely efficient and parts of it coded in assembly if I'm not mistaken.
Re:Turbo Pascal Turns 40 by ale42 on Thursday November 30, 2023 @04:41PM (#38479596)
I think that the question was rather why it took 25 seconds to the current compiler to compile an Hello world on a contemporary computer... Turbo Pascal would have definitely done that in a second or less on an 8086 CPU...
Re:Turbo Pascal Turns 40 by tomcam on Thursday November 30, 2023 @05:02PM (#38479819)
It was completely written in assembly
Re:Turbo Pascal Turns 40 by agumonkey on Thursday November 30, 2023 @05:19PM (#38479996)
hand written and also optimized for throughput right ? maybe pascal syntax was also parsing friendly.. i don't recall

one thing for sure is that it felt near instant if not real time building small projects, to the point that 14yo me was completely unaware of meaning of Compile until years later.

Re:Turbo Pascal Turns 40 by tomcam on Thursday November 30, 2023 @07:30PM (#38481302)
What bear8642 says. I worked with Anders and interviewed the poor man about it!
Re:Turbo Pascal Turns 40 by bear8642 on Thursday November 30, 2023 @05:24PM (#38480039)
>maybe pascal syntax was also parsing friendly..

Yep, designed to be single pass, recursive descent friendly

Re:Turbo Pascal Turns 40 by vram22 on Friday December 01, 2023 @02:36AM (#38484169)
And despite being single pass, you could call functions and procedures before you defined them (later in the code), by using the forward declaration feature of Pascal.

Because of this feature, the language could also support mutually recursive functions, which some other languages might not have been able to (not sure).