Live data from Hacker News

Ask HN: Why Did Pascal Fail?

news.ycombinator.com

81–90 of 168 posts

Re: Ask HN: Why Did Pascal Fail?

#81
post #4

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

Although an interesting reading from Kernighan in the temporal and industry context (let us remember he worked for years building UNIX, the greatest reason C still survives, and published the reference C book), it is also interesting to see that at least six of his arguments against Pascal (namely, 1, 2*, 5, 6, 8*, 9, where only part of the arguments 2 and 8 should be considered) are actually considered best practice…

Re 1/2 - I don't follow? The criticism is not against fixed array types or statics. It's that it has those traits and there is no escape hatch. Functional languages with strong type systems are flexible enough to operate over arrays/strings generically. And static/global is absolutely used. The difference is nowadays there are stronger controls to access (e.g. rust's lifetimes and borrow checking).

I don't know much about Pascal but it sounds really hard to do things which aren't supported by the development environment.

Re: Ask HN: Why Did Pascal Fail?

#82
> A typed, compiled language easy to program.

The thing about these early language designs is that it's really only their "toy" language subset that's truly easy to program. Once you try and extend a comparatively simple language like PASCAL to deal with all the complexities of truly large-scale software development you end up with something not unlike ADA, where the verbose syntax just gets in the way of surveying a complex program effectively.

I think Go and Rust both made very good syntactical choices in picking just a handful of very short mnemonic keywords (and symbols like {}) for things that simply have to be foundational language features, while making longer names fully idiomatic for identifiers that are defined in the code.

Of course the PASCAL language family makes very different choices here (as do other languages, such as COBOL and BASIC). I'm not saying it wouldn't be cool in some way to see a language design with e.g. a Rust-like featureset and PASCALish syntax; I just don't think it would ultimately be easy to learn and use practically.

Re: Ask HN: Why Did Pascal Fail?

#83
post #74

Pascal had problems that kept users from doing anything useful with it. Real-world implementations included bypasses for the problems, but then they weren't really implementing Pascal any more. Kernighan's famous article "Why Pascal Is Not My Favorite Programming Language" explains more: http://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pasc...

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…

Only 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 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.

Re: Ask HN: Why Did Pascal Fail?

#84
post #37

Basically Turbo Pascal overshadowed all other Pascal dialects and then Borland got greedy, decided that Fortune 500 were going to be their main customers in detriment of the small dev shops. Additionally Anders got fed up with the ongoing culture and finally accepted the invitation of former ex-colleges to join Microsoft. So J++ was born, then .NET, and most of the folks on Windows just moved from Delphi into C#.

> and then Borland got greedy, decided that Fortune 500 were going to be their main customers in detriment of the small dev shops.

AIUI, that only happened very recently, well past the C# thing and perhaps only after the change from Borland to Embarcadero. For a long time, Delphi was actually a very reasonably accessible and effective competitor to Visual Basic.

Re: Ask HN: Why Did Pascal Fail?

#85
post #73

Earlier quoted context omitted.

> The contents of that post have not been relevant for decades. But decades ago is precisely the timeframe we're talking about here. Pascal lost to C for the reasons Kernighan mentions (among others), which is the question the OP was asking.

I'm not sure Pascal entirely lost due to just C. Borland's Turbo Pascal was quite popular and was broadly used in the mid 80s. Apple even used their own Object Pascal variant through-out the 80s. Pascal was primarily used for application development and for this case it was leagues ahead of C and C++. Turbo Pascal thrived up until Delphi was released in 1995, which then became the new lead Pascal. Unfortunately, Delp…

> I'm not sure Pascal entirely lost due to just C. Borland's Turbo Pascal was quite popular

Look at which one is being used to this day to write essentially every modern operating system, and even the interpreters and compilers for other languages. JavaScript engines are written in C, not Pascal.

I think it obviously did lose, though judging from the moderation it clearly still has some fanatical followers.

Both Turbo Pascal and Object Pascal had so many extra non-standard and un-Pascal-like features that they were barely even the same language.

As I mentioned in another comment, allowing you to write bare assembly language inline wasn't exactly a feature of the original Wirth Pascal. The analogy I used at the time was that (Wirth) Pascal was like a pair of blunt-pointed kindergarten scissors, while C was more like a chainsaw. Borland added enough non-standard features to make it more like maybe a kitchen knife, but in the long run that still wasn't enough.

Re: Ask HN: Why Did Pascal Fail?

#86
post #71
post #34

Earlier quoted context omitted.

Pascal is generally not an interpreted language. It is a compiled language that is suitable for systems and applications programming.

As far as I remember, Pascal admitted single-pass analysis. Such languages are especially amenable to being interpreted, i.e. immediately translated into executable actions (vs. some sort of bytecode).

Wirth devised P-Code, only as means to ease porting the language into new platforms, it was the UCSD Pascal that based an whole system on it.

Most Pascal compilers were actually compiled, either directly, or by converting the above P-Code into machine code via an additional pass, e.g. Corvus Systems

https://en.wikipedia.org/wiki/Corvus_Systems

Re: Ask HN: Why Did Pascal Fail?

#87
post #83
post #74

Earlier quoted context omitted.

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…

Only 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 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.

Thanks for clearing that up

Re: Ask HN: Why Did Pascal Fail?

#88
post #64

Earlier quoted context omitted.

Compilers actively translate code into a representation understandable by the machine. It just so happens that the “machine” is an abstraction of a CPU. Interpreted Javascript doesn’t fit this bill. If compiled to web assembly then it would.

V8 compiles all JavaScript it executes to machine code. There is no interpreter included in v8.

https://v8.dev/blog/sparkplug

> As we turn to improving the performance of the actual initial JavaScript execution, however, we start to hit limitations when optimising our interpreter. V8’s interpreter is highly optimised and very fast, but interpreters have inherent overheads that we can’t get rid of; things like bytecode decoding overheads or dispatch overheads that are an intrinsic part of an interpreter’s functionality.

Re: Ask HN: Why Did Pascal Fail?

#89
post #33

Lack of portability: the 'standard' Pascal was very limited and each implementation added its own incompatible extension. So when a free C compiler was released..

In the early days, if you wanted a proper C compiler you had to log into a UNIX.

C compilers available for 8 and 16 bit computers weren't even fully K&R C.

Re: Ask HN: Why Did Pascal Fail?

#90

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…

Turbo Pascal was available for Windows.
Post reply on HN