Live data from Hacker News

Ask HN: Why Did Pascal Fail?

news.ycombinator.com

51–60 of 168 posts

Re: Ask HN: Why Did Pascal Fail?

#52

C was faster. It's that simple. Computers were extremely tiny in those days.

Along those lines... on MS-DOS/x86, memory model support in (Turbo) Pascal was less flexible than in Turbo C (1.0) during the first years when those toolchains were competing and gaining critical mass:

TP 3.0 generated COM files (near code, near data, far heap-allocated data).

TP 4.0 generated EXE files (far code, near data, far heap-allocated data).

(the above is "to the best of my recollection": I no longer have the manuals for these toolchains; it might be the case that in TP 4+ all data is far (pointers to data were far)).

A TP coder was generally forced to live within these constraints (and adapt to the memory model changes described above across the 3 -> 4 transition).

Turbo C 1.0 came along within a year or so of TP 4.0, and (because it was actually not a 1.0 implementation but a rebranding + enhancement of an existing toolchain acquired by Borland) supported all permutations of x86 memory models, allowing the coder to choose according to their needs (and explicitly define near and far functions and data as needed independent of the memory model used w/o a need to drop into [inline] asm).

Turbo C's giving the programmer total control and optimization flexibility along these axes, which was a function of the language _implementations_, not the languages themselves, I believe contributed to the "C was faster" outcome (from TP 4 onward, there was (inline asm aside) IIRC no way to instantiate near functions). Turbo C was not the only C implementation for MS-DOS, but IIRC it immediately became the most popular, and held that crown for many years; other entrants needed to match Turbo C's features or die.

[edit]

Microsoft offered a MS-DOS C compiler (long?) prior to the release of TC 1.0, which supported the same memory-model permutations as TC 1.0. However it was at least 3x more expensive than TC 1.0, so when TC 1.0 was released at such a low price, it grabbed a lot of market share (by expanding the market to include programmers with smaller budgets). There were at least a few more MS-DOS C toolchain competitors already on the market when TC 1.0 was released (but I never used them so cannot comment futher on them).

Re: Ask HN: Why Did Pascal Fail?

#53
post #39

Earlier quoted context omitted.

Fast where? Borland compilers were basically the same, and if one cared about speed, the only way to achieve it was hand written Assembly.

I don't know if the Pascal code ran slower, but the Borland compilers were plenty fast.

Turbo Pascal was a very fast compiler, written in assembler.

I'm a Delphi developer, and have spent about 24 of the past 36 years programming in Pascal. The Delphi XE7 compiler (now about 8 years old) can on a one year old Lenovo laptop with 16 GB RAM compile 1.35 million LOC (in 80 different files) in 11 seconds. The 64-bit compile takes roughly twice as long.

One of the design features of Pascal was a one pass compile which explains the speed. Note also that the Delphi/Turbo Pascal compilers are smart and discard all unused code.

Re: Ask HN: Why Did Pascal Fail?

#56

As someone who started their computer science studies with Pascal and then switched to C (I use C for comparison because it was the dominant programming language in 1990s computer science programs) , I can say that C just offered more to the aspiring software developer. For most people who coded in the 90s Pascal meant Turbo Pascal. While the language itself was great, MS-DOS where it ran not so much. Especially when…

This. I think Pascal was great but C just offered more. Especially when C++ came around and stole all the mindshare.

Re: Ask HN: Why Did Pascal Fail?

#58

Studying electrical engineering starting 1985 our school used Pascal for first year and then ran with Modula 2 for subsequent years. In those days we were mostly on time share Vaxen, even as EE students only maybe 20% of students had any kind of PC or real computer at home. As of now I can't remember exactly why, but it seemed obvious to me at the time C was the place to be going forwards, maybe because I was working…

My uni taught Modula2 until 1999 basically. To be fair though Java was about to replace it but python was around and could've been used.

Re: Ask HN: Why Did Pascal Fail?

#59
post #40
post #4

http://www.lysator.liu.se/c/bwk-on-pascal.html

UNIX propaganda that was already out of date when it was published.

I always think it ironic that the C order of variable declaration prevailed for so many years (C++, C#, Java) yet in recent times several newer languages have discovered that the Pascal declaration order is handy for compiler type inference.

var age : integer; pascal

var age int - Go

var age : int - Swift

var age = 52; - Dart

var age: Int = 10 Kotlin

Re: Ask HN: Why Did Pascal Fail?

#60

I used Turbo Pascal a lot as a teenager. Then I switched to Java and never looked back. For me the main reason was garbage collection. String size was limited to 255 (non-Unicode) characters, array size needed to be specified at compile time, everything beyond this required manually allocating and unallocating memory... okay for school projects, but too much work for anything more complicated. The standard library di…

Yes. My TP programs were more than 50% inside asm...end blocks and would break even if you switched out the graphics card let alone tried them on a different architecture.
Post reply on HN