Why Pascal Is Not My Favorite Programming Language (1981) [pdf]
doc.cat-v.org
doc.cat-v.org
You can reply point by point about how it is factually wrong about Delphi:
e.g.
> There is no break statement for exiting loops.
Delphi has a "break" statement. (1)
> case statement ... there is no default clause
Yes there is, the "else" case. (2)
Many of these "extended syntax" features were likely added due to the criticisms in this paper. So in one sense the paper was valuable in causing that, in another sense it's usefulness was over by the late 1990s.
And then the eventual fallback argument is: "Ok, then Delphi is not Pascal" which was technically true, but then this article is allowed to stand as "an argument against Pascal (not Delphi)"
... and is soon picked up again as an argument against Delphi (because it's "Pascal" ).
Round and round it went. So tiresome and ignorant.
It wasn't even true for Turbo Pascal before Delphi.
In a few cases, like TeX and STiP, the solution was to write in standard Wirth and Jensen Pascal, despite the inconveniences. Most people instead resigned themselves to writing nonportable code.
By the way, I see that the comment window has closed, but I'm still interested in your thoughts on https://news.ycombinator.com/item?id=22083468 — it represented a fair bit of effort on my part, and it's disappointing that you haven't answered at all.
[Edit: On reflection, you're addressing a different topic. The question the rest of us are talking about is "was Pascal that bad?". And the answer is, "yes".
You want to talk about something else - Pascal vs. C. But in C, you could at least do "#ifdef Compiler_A" to achieve "portability". Yeah, it's not very good portability, but you could get to one source file that would compile with different compilers. For Pascal, so far as I know, you couldn't do even that much.]
IIRC Turbo Pascal 7.0 (aka Borland Pascal 7.0; I never unstood the difference) added syntax highlighting but mostly focused on adding Windows support (meh).
I wrote my first web apps as BP7 win-cgi apps back in 1995.
Turbo products were the "community/student", while the Borland were the "professional" variant with more tooling and compiler optimisations.
Ah.. Over here in northern Europe we'd typically just pirate everything from our school's installation so we weren't really aware of any marketing differences. Thanks for clearing up a long-time mystery :). (We ended up with an install that had both bp.exe/tp.exe and bpc.exe/tpc.exe, and they seemed to behave identically. bp/tp.exe was the IDE, bpc/tpc.exe was the commandline compiler.)
I think Turbo Pascal for Windows was like a branch, but then TP7/BP7 brought it into the mainline. Just before the mainline was reworked into what became Delphi.
It's not quite as solid as Delphi was, but then again I don't have $5k to dump on a compiler right now.
Nonetheless Pascal-like languages have had some moderate success over some 40+ years from original Pascal to Turbo Pascal to Object Pascal to Delphi (not to mention many other languages from Ada to VHDL.)
Wirth's Oberon ecosystem is also beautiful and uses Pascal-like languages to describe everything from his RISC CPU (specified in Lola) up to entire operating system and user environment (written in Oberon.)
Personally I enjoy reading Pascal/Delphi/Modula-3/Oberon code, and I'm fascinated by the Oberon system as an example of how things can be small yet also clear and capable.
Nowadays there is FreePascal and Lazarus, that support many platforms and have a lot of features.
Any general-purpose programming language, pascal or not, will eventually have that. But it might not be in a general language standard.
> It is unfortunate that there is no way to make this convenience available to routines in general.
Let's not talk about Pascal from over 40 years ago, let's talk about today's Pascal. Why can't you write "writeln" in today's Pascal?
So having writeln isn't really the issue, the issue is that writeln is magic/a built-in.
Is free pascal self hosted?
Yes.
Also, yes, Free Pascal is entirely self-hosted from the bottom up, making use of inline assembly blocks in some places where it's necessary. It is to Pascal what GCC is to C and C++, basically (which is to say, it has no real dependencies on toolchains other than itself).
You don't, it has to be in Assembly or calling underlying OS APIs.
So also a nail in C's coffin.
exit: longjmp.
According to C99 section 6.5 paragraphs 6-7 that would be undefined behavior. The declared type of the object is uint8_t and you're accessing it through an lvalue expression which is not compatible with uint8_t. (You can access any object through a character-type lvalue, but the reverse is not true.) The malloc() function is required to return memory which is disjoint from any other object—that includes your uint8_t array.
Besides aliasing concerns, your character array may not be properly aligned for whatever type is being stored there and there is no way within the C99 standard to determine the alignment of the array or the required alignment for the stored type.
> exit: longjmp.
That might work, in a single-threaded program, if you longjmp() back to main() and return. There's no telling what might happen if you did that from another thread, of course, but then C99 doesn't really cover threads.
So exit() gets to call longjmp() which definitely can only be done in Assembly, back to step 1.
C was a guest language via MPW, and plugged into those APIs.
https://www.freepascal.org/docs-html/ref/refsu69.html
That said, as far as at least Free Pascal goes, there isn't actually even a specific function called `writeln` with a real body that you can go and look at somewhere.
It's a magic language-level intrinsic that gets broken down into calls to various other intrinsics by the compiler based on what's passed to it.
Pascal could have been our present, but now we live the mistake of base so much on top of C/C++, and because we never learn, repeat with JS.
The damage to Pascal was from Pascal, not this paper or the viewpoint it represents.
(I'm not going to defend JS, though...)
That is like to work in first generation C.
But the viewpoint cause massive damage: Pascal get a reputation based in the first version with a limited scope, despite have very good points at his favor.
In a modern example, is like dismiss GO because lack of generics and verbose error handling, and consider C better for some OTHER reasons, that is what actually happened with pascal and other langs.
ie: Happens ofter that some critize lang/tool for X (could be truth) ignore Y (that is a good point) and still choose Z (for other reasons).
In the case of C: Is more popular, can I do funky things with pointers, my OS is made on that.
Now, Pascal improved. Various versions fixed various flaws in various nonstandard ways. But the same was true of C.