Live data from Hacker News

Ask HN: Why Did Pascal Fail?

news.ycombinator.com

131–140 of 168 posts

Re: Ask HN: Why Did Pascal Fail?

#131
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.

Ignoring templates and generics, any Turing-complete language can be compiled down to bytecode or machine code.

So when developers talk about a “compiled language” they really mean if the standard tooling supports a compiler; and if programs are generally distributed already-compiled.

There are implications (good and bad) to programs that are already compiled, versus a just-in-time compilation via a runtime engine; which is largely transparent to developers and end-users.

Re: Ask HN: Why Did Pascal Fail?

#132

The leading implementation was by Borland, which addressed most of the limitations of the language, and provided a solid compiler and IDE in Turbo Pascal, then Delphi. Borland started raising the prices of their compilers to the point that the hobbyist could no longer justify it, and market share fell accordingly. Since Turbo Pascal/Delphi was the only Pascal with a complete library, the fortunes of the language went…

Before that, there was a time when "most of the limitations of the language" had not been addressed. I had the misfortune to have to program in the language in that time, and it was painful. Part of the reason C took over the world and Pascal did not is that, in this time, C was much less annoying to use than Pascal. Borland fixed that, and brought Pascal to parity with C. (Maybe even ahead of C, because Pascal had b…

In my freshman year, we had to use Pascal. Running on a 60-bit CDC 6600. With punchcards.

My only memory of the actual language experience (i.e. besides the card punch) was being marked down on an assignment for using an implicit conversion that the compiler coded personally by Niklaus Wirth permitted. I had coded it with the explicit conversion, first, and then took it out because the compiler said I didn't need it.

Pascal was better than C in exactly one respect: it used a post-fix pointer dereference operator. C could have defined a unary postfix ->.

C++ could still do that, entirely backward-compatibly, and have it call unary operator*().

Re: Ask HN: Why Did Pascal Fail?

#133
post #119

Earlier quoted context omitted.

Kernighan 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 no…

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

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

Re: Ask HN: Why Did Pascal Fail?

#134
post #67

Pascal was the teaching language in the early 80s. I had compilers available for the IBM 370 (VM/CMS), the VAX (VMS) and even cross-compilers for bare metal MC68000 and PDP/11. Early Macintosh development used Pascal (though it wouldn't run on the earliest Macs) It wasn't ideal for every use, and Prof. Wirth, an academic, basically left extending the language to the compiler vendors. Now I'm teaching freshman softwar…

It is a good thing you only teach Python if you are using expressions like "C/C++". I expect you would be teaching C++ as if it were C, skipping everything that makes it usable and useful as if they were "advanced topics".

Re: Ask HN: Why Did Pascal Fail?

#135
post #41

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.

You mean features that were actually available in Pascal dialects, during the days when C outside UNIX was based on K&R C dialects like Small-C? Also considering that most of the complains were fixed in Modula-2, made available initially in 1978.

Most people at the time had never heard of Modula-2, and in any case had no ready access to a compiler for Modula-2. You have already had pointed out that the dialects you promote were all mutually incompatible, with no preprocessor to help paper over differences. Anybody wanting to write portable code was stuck.

And, the article was about Pascal, not about Modula-2. Are you wishing he had also written an article about Modula-2 that you could also critize, maybe for not being about Modula-3 or Oberon instead?

Re: Ask HN: Why Did Pascal Fail?

#136
post #92

Earlier quoted context omitted.

> 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 Turb…

> JavaScript engines are written in C, not Pascal. Which one? Unless you forgot to type ++.

To be fair, they are probably written in bad C++.

Re: Ask HN: Why Did Pascal Fail?

#137
post #70

Earlier quoted context omitted.

It is so complex that people came up with tooling to actually understand when some devs go wild, https://cdecl.org/ Also the main reason behind the religous war in C++ of west const versus east const. Microsoft now got a couple of top devs on their C++ team that are on east const, so while we have about 25 years of Microsoft documentation, code samples and libraries using west const, the C++/WinRT team is now pushing…

Oh, and don’t forget the eternal holy war for the right asterisk/ampersand location! (SomeType* ptr vs. SomeType *ptr) https://stackoverflow.com/questions/2660633/declaring-pointe...

That is mostly just a C vs. C++ thing. But a few C++ programmers use west *, mostly just to be a PITA.

Re: Ask HN: Why Did Pascal Fail?

#138
post #4

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

If this is an exercise in reading comprehension I suppose we should begin by trying to identify the author's purpose — persuade, inform, or entertain — and distinguish between facts and opinions.

Re: Ask HN: Why Did Pascal Fail?

#139
post #8

I wouldn't say Pascal completely "failed". e.g. Delphi was quite popular at some point.

Pascal was crowded out of its niche by Delphi. It could have been supplanted by Modula-2, instead, or Oberon, UCSD Pascal, Object Pascal, Apollo Pascal, or any number of other languages with syntactic similarities to Pascal. But it wasn't.

Pascal was displaced by K&R C for mainstream work, which was soon supplanted by C90. C90 has been displaced from serious development work by various C++ versions, although it hangs on in restricted niches, for historical reasons, usually as C99 and sometimes C11. C++98 has been largely supplanted by C++11, which is beginning to be supplanted by C++17 and C++20.

It doesn't make sense to say that Pascal is alive when there is no one, anywhere writing code that could be compiled by any actual Pascal compiler, and no actual Pascal compilers for any current machine.

Post reply on HN