The first real programming language I had sunk my teeth into. The old days of programming my own Tetris and battlesnake on a dos display. Although I had learned some favour of basic before that but Pascal and later Delphi were what got me started
Pretty cool to see this, and that it's still alive and well.
Pascal was my first language, but only because it happened to be used for scripting repetitive tasks for a game I played. I had a blast, even though there were far more modern options.
In the 90's, I had no Internet. The library (neither school nor public) had no programming books. My high school had no CS/programming classes. The computer class (word processor/spreadsheet usage) teacher did not know anything about programming, but she knew that I liked computers. One day, she gave me a big yellow box and said "I don't know anything about this, but I thought that you might like to play with it."
All that I had was 3.5" diskettes and the manuals. Those manuals were written so well that I taught myself programming by reading them and their examples. I still remember the day that I figured out what a pointer was, simply by their example code.
I am forever grateful to that teacher, as well as the writers of those manuals. Today, I have a PhD in CS, but I have never had a programming class (I have taught them, however). It was the design of the Pascal language that allowed for that.
I've never used Pascal but i completely resonate with your experience of old manuals. They were well written and one could use them to study and not just refer to.
They had a usage example for each API function, that was great for readability. Today we can get that experience back with chatGPT, but there was a gap of 30 years since then.
Another major usability thing was the debugger. One of the best debuggers to this day, it had just the basics, but they were well integrated into the IDE. Alt-F5 to flip the screen from code to output, right? if I remember.
What exactly does it say? I have no personal experience with any historical or current Pascal implementation. I would be curious to hear your point of view.
Niklaus Wirth's Pascal was more of a teaching tool than a useful programming language. It took a lot of extensions to fix that, and each Pascal inventor invented their own extensions.
I know this from having read his book and using an early Pascal compiler, and being very frustrated with it.
Pascal did, however, have a very nice feature - nested functions. It's the one feature from Pascal that I incorporated into D, and they're such a nice feature I continue to be surprised they aren't adopted by other languages.
It is a very nice feature. As far as I know, it is a common pattern in Scala and I also do it in Julia (although there might be some small performance penalty).
It just makes complex code much more readable without polluting the module's scope.
So I am not sure how common it is, but there are at least some languages that allow this.
> Niklaus Wirth's Pascal was more of a teaching tool than a useful programming language.
Which is one reason I don't like self-conscious "teaching" programming languages: They rarely escape the stench of condescension that pervades such endeavors, which means they lack features some designer or team of designers though were "too advanced" for early learners but which are essential to writing any nontrivial code. See also: BASIC, another language where the standard is honored more in the breach than the observance, to the point that "Basic" is more of a "vibe" than any actual set of syntax and features you can point to. (In fact, modern nice Basic dialects have nearly converged with Object Pascal.)
> Pascal did, however, have a very nice feature - nested functions. It's the one feature from Pascal that I incorporated into D, and they're such a nice feature I continue to be surprised they aren't adopted by other languages.
Not that you don't know this, of course, but GCC has long has nested functions as an extension to the C programming language. Which, again, is an example of a nice quality-of-life feature added to a somewhat lacking language as a nonstandard extension. Oh, well.
> GCC has long has nested functions as an extension to the C programming language
I know. Yet, it still hasn't gotten into the C Standard. I've also never seen it used in practice, whereas in D we use it everywhere. I constantly find handy new uses for it.
I don't think it says anything nasty, AFAICT that was Wirth's approach to languages in general: they were all meant to be modified and extended for each platform and need. Even his own implementations had extensions to accommodate what it needed to do (e.g. IIRC his Oberon-07 implementation for ARM had some additional data types).
Besides in practice in the last ~3 decades or so every implementation was based on Borland's dialect (which AFAIK was based on the UCSD dialect).
Also FWIW Free Pascal is both open source and has a mode to compile code in standard Pascal, though it was added relatively recently (version 3.0.0 released in 2015 - i wrote "relatively" because the compiler exists since the mid-90s).
Me too, because learning Turbo Pascal 3.0 after Turbo Basic, using all the versions up to Turbo Pascal for Windows 1.5, showed me a path to systems programming without C, and safety.
Also why alongside Turbo Pascal, when I came to learn C via Turbo C 2.0 and a book on RatC, the high school teacher also happened to have a copy of the newly released Turbo C++ 1.0.
So in 1993, it became clear to me that the alternative to Turbo Pascal, as cross platform language could only be C++, C already looked primitive by Turbo Pascal standards in early 1990's, and at least C++ provided the language features to be almost as safe as TP, with similar feature level.
I used Turbo Pascal 2.0 from 1984 as late as 1991. It was what my dad's work-from-home PC happened to have installed and there was no internet to just go download newer software when you wanted it. Only had some old 1970's Pascal textbook and the example-code bundled with Turbo Pascal 2.0 to learn how to use it and that was enough to make some silly little games and learn a lot about programming (beyond what I could do earlier with GWBASIC).
Had fun in recent months installing fpc on all my computers and playing with it and it seems really good. Cross-platform support is amazing, possibly the best I have ever seen.
FreePascal does win64 and pretty much every other platform from the last 30-40 years as well. I think you can still use it for win32 and win16 if you want to. I used it to cross-compile to 16-bit DOS and 32-bit DOS, and also various 32-bit and 64-bit ARM targets as well as 64-bit intel Windows, Linux, and FreeBSD. Seems to work everywhere.
At least for writing cross platform desktop apps, I think nothing beats Lazarus/FPC. One codebase that works on Windows, Linux, macOS. And not tied to JVM/Electron etc.
There are some web frameworks in Pascal like Fano or Brooke. Never personally use it.
Want to write Android apps? There's LAMW. No iOS equivalent in FOSS world, AFAIK. Probably you want to use Delphi for this purpose.
Conclusion: still OK, overall. Considering those implementations are not backup up by giant companies like Google, MS, etc.
Learned Pascal because it was all I could download quickly and use with limited internet in the swamps of Florida in 03-04. Honestly I feel it made me a much stronger programmer by giving me a completely different paradigm while learning Java going for CS.
It is a solid language, but I wouldn't really recommend picking it up today.
I think the main reason the Wirthian languages lost was firstly that Pascal wasn't designed for real world use. It was designed as a teaching language, although many implementations, such as Turbo Pascal, extended it to make it useful for real world use. This allowed C to gain popularity in spite of it being unsafe and lacking strong typing.
Modula-2 came next and it was a huge improvement over Pascal but Ada came out within two years and stole Modula-2's thunder. Oberon came out even later but Ada was pretty big by that time and Oberon didn't get much use. By the mid to late 80's, Ada was the most popular language, even more popular than C and C++, for a couple of years.
But then C++ overtook it. Why? Because computers were slower back then and people didn't want to give up any cycles to safety. After all, no one was online yet so security wasn't a huge concern. I think the verbosity of Ada also hurt it. In those days, most programmers hadn't taken typing courses.
Then the US military relaxed the requirement to use Ada and it declined, but is still in use in applications today requiring high safety such as at NASA and air traffic control systems. NASA is using it in the Artemis programs.
It began with ALGOL and it ended with Pascal because Modula-2, Ada and Oberon got rid of BEGIN except one in each PROCEDURE after variable definition and before the code begins.
In Pascal, an IF statement looked like this:
IF <cond> THEN BEGIN <true block> END ELSE BEGIN <false block> END END
But Modula-2 and Oberon look like this:
IF <cond> THEN <true block>; ELSE <false block>; END
And Ada looks like:
IF <cond> THEN <true block>; ELSE <false block>; END IF;
I program in Pascal every day, and I still love it.
Microsoft Dynamics 365 Business Central has a built-in development environment with a language called AL. AL is a variant of Pascal.
A bit of background, Pascal was very popular in Denmark in the 80'ties and 90'ties (Turbo Pascal was created by a Dane, Anders Hejlsberg, later Delphi, c# and TypeScript fame). Business Central was a Danish piece of software created for IBM before Microsoft acquired it, so choosing Pascal as the base language was a very natural thing.
I got my first job because IBM needed Pascal developers for this new accounting system they got and I already knew Turbo Pascal.
Today the AL compiler is built on Roslyn (same as the c# compiler) and have a fully capable language server supporting all the fancy intellisence stuff in VS Code, also supported by GitHub CoPilot.
It's nice to see this kind of Pascal community event. I write a program in Pascal for fun, for work or play, every few months.
The one I use, fpc/Lazarus, is one of those projects where people seem to use it for very significant work to a very high degree of personal satisfaction, but often to very little fanfare.
Like let's say you built the world's fastest JSON viewer with it (already done, I think).
Or you built a pretty amazing orthodox file manager with it (DC).
Or a great little text editor? Cudatext. The author wrote a plugin at my casual mention of the topic of snippets that could run external commands, which I thought was awesome of them.
Lazpaint is also pretty neat and I was able to make a pseudo-3D render with it. Very nice set of tools.
Those are each a pretty big deal in their own ways. But these days there's another public-presence layer to development, where people want to find Mr. Lazarus chocolate bars on the shelf at their local store before they'll trust that it's worth their time, maybe. (I hear creator brands are pretty much everything right now?)
Yet, the fact that it's around, well maintained, and used in very impressive projects, still means a lot to those who are interested in what it can do.
And, I guess it still does some new stuff as needed. Pas2JS, webassembly, etc.
I played around a bit with fpc earlier this year (yes, 2023). Ported a little game I made using Turbo Pascal 2.0 (had to implement some old graphics procedures that did not seem to be available in fpc; looks like it only has backwards-compatible graph procedurs in the style of Turbo Pascal 4.0 and later?). It was fun! I played around a bit more with fpc for various platforms and it seems to work very well. Surprising to not hear so much about it really. From a quick look Lazarus looks useful as well but I have not tried it yet.
> Or you built a pretty amazing orthodox file manager with it (DC).
Fun fact: Double Command is a clone of Total Commander, itself also written in Pascal (the 32bit version is compiled using Delphi and the 64bit version using Free Pascal / Lazarus).
Also a somewhat popular archiving tool in recent years, peazip, is made in FPC / Lazarus too.
I think Ada (which was based on ALGOL, Pascal and Simula) stole much of Modula-2's and Oberon's thunder. Ada was more popular than C or C++ for a couple of years in the mid to late 80's.
37 comments
[ 2.7 ms ] story [ 42.0 ms ] threadPascal was my first language, but only because it happened to be used for scripting repetitive tasks for a game I played. I had a blast, even though there were far more modern options.
In the 90's, I had no Internet. The library (neither school nor public) had no programming books. My high school had no CS/programming classes. The computer class (word processor/spreadsheet usage) teacher did not know anything about programming, but she knew that I liked computers. One day, she gave me a big yellow box and said "I don't know anything about this, but I thought that you might like to play with it."
All that I had was 3.5" diskettes and the manuals. Those manuals were written so well that I taught myself programming by reading them and their examples. I still remember the day that I figured out what a pointer was, simply by their example code.
I am forever grateful to that teacher, as well as the writers of those manuals. Today, I have a PhD in CS, but I have never had a programming class (I have taught them, however). It was the design of the Pascal language that allowed for that.
I'm glad that it is still going.
Another major usability thing was the debugger. One of the best debuggers to this day, it had just the basics, but they were well integrated into the IDE. Alt-F5 to flip the screen from code to output, right? if I remember.
I know this from having read his book and using an early Pascal compiler, and being very frustrated with it.
Pascal did, however, have a very nice feature - nested functions. It's the one feature from Pascal that I incorporated into D, and they're such a nice feature I continue to be surprised they aren't adopted by other languages.
It just makes complex code much more readable without polluting the module's scope.
So I am not sure how common it is, but there are at least some languages that allow this.
Which is one reason I don't like self-conscious "teaching" programming languages: They rarely escape the stench of condescension that pervades such endeavors, which means they lack features some designer or team of designers though were "too advanced" for early learners but which are essential to writing any nontrivial code. See also: BASIC, another language where the standard is honored more in the breach than the observance, to the point that "Basic" is more of a "vibe" than any actual set of syntax and features you can point to. (In fact, modern nice Basic dialects have nearly converged with Object Pascal.)
> Pascal did, however, have a very nice feature - nested functions. It's the one feature from Pascal that I incorporated into D, and they're such a nice feature I continue to be surprised they aren't adopted by other languages.
Not that you don't know this, of course, but GCC has long has nested functions as an extension to the C programming language. Which, again, is an example of a nice quality-of-life feature added to a somewhat lacking language as a nonstandard extension. Oh, well.
I know. Yet, it still hasn't gotten into the C Standard. I've also never seen it used in practice, whereas in D we use it everywhere. I constantly find handy new uses for it.
Besides in practice in the last ~3 decades or so every implementation was based on Borland's dialect (which AFAIK was based on the UCSD dialect).
Also FWIW Free Pascal is both open source and has a mode to compile code in standard Pascal, though it was added relatively recently (version 3.0.0 released in 2015 - i wrote "relatively" because the compiler exists since the mid-90s).
As for the proprietary part, fpc exists.
Also why alongside Turbo Pascal, when I came to learn C via Turbo C 2.0 and a book on RatC, the high school teacher also happened to have a copy of the newly released Turbo C++ 1.0.
So in 1993, it became clear to me that the alternative to Turbo Pascal, as cross platform language could only be C++, C already looked primitive by Turbo Pascal standards in early 1990's, and at least C++ provided the language features to be almost as safe as TP, with similar feature level.
Had fun in recent months installing fpc on all my computers and playing with it and it seems really good. Cross-platform support is amazing, possibly the best I have ever seen.
There are some web frameworks in Pascal like Fano or Brooke. Never personally use it.
Want to write Android apps? There's LAMW. No iOS equivalent in FOSS world, AFAIK. Probably you want to use Delphi for this purpose.
Conclusion: still OK, overall. Considering those implementations are not backup up by giant companies like Google, MS, etc.
It is a solid language, but I wouldn't really recommend picking it up today.
While you typed that a C developer could already have written a memory violation bug, think of the productivity increase
C might not have been effectively better (Pascal strings were better) but it had a feeling of increased productivity
Modula-2 came next and it was a huge improvement over Pascal but Ada came out within two years and stole Modula-2's thunder. Oberon came out even later but Ada was pretty big by that time and Oberon didn't get much use. By the mid to late 80's, Ada was the most popular language, even more popular than C and C++, for a couple of years.
But then C++ overtook it. Why? Because computers were slower back then and people didn't want to give up any cycles to safety. After all, no one was online yet so security wasn't a huge concern. I think the verbosity of Ada also hurt it. In those days, most programmers hadn't taken typing courses.
Then the US military relaxed the requirement to use Ada and it declined, but is still in use in applications today requiring high safety such as at NASA and air traffic control systems. NASA is using it in the Artemis programs.
In Pascal, an IF statement looked like this:
IF <cond> THEN BEGIN <true block> END ELSE BEGIN <false block> END END
But Modula-2 and Oberon look like this:
IF <cond> THEN <true block>; ELSE <false block>; END
And Ada looks like:
IF <cond> THEN <true block>; ELSE <false block>; END IF;
Microsoft Dynamics 365 Business Central has a built-in development environment with a language called AL. AL is a variant of Pascal.
A bit of background, Pascal was very popular in Denmark in the 80'ties and 90'ties (Turbo Pascal was created by a Dane, Anders Hejlsberg, later Delphi, c# and TypeScript fame). Business Central was a Danish piece of software created for IBM before Microsoft acquired it, so choosing Pascal as the base language was a very natural thing.
I got my first job because IBM needed Pascal developers for this new accounting system they got and I already knew Turbo Pascal.
Today the AL compiler is built on Roslyn (same as the c# compiler) and have a fully capable language server supporting all the fancy intellisence stuff in VS Code, also supported by GitHub CoPilot.
p.s. I even created my own AL compiler, written in AL https://www.hougaard.com/toolbox
The one I use, fpc/Lazarus, is one of those projects where people seem to use it for very significant work to a very high degree of personal satisfaction, but often to very little fanfare.
Like let's say you built the world's fastest JSON viewer with it (already done, I think).
Or you built a pretty amazing orthodox file manager with it (DC).
Or a great little text editor? Cudatext. The author wrote a plugin at my casual mention of the topic of snippets that could run external commands, which I thought was awesome of them.
Lazpaint is also pretty neat and I was able to make a pseudo-3D render with it. Very nice set of tools.
Those are each a pretty big deal in their own ways. But these days there's another public-presence layer to development, where people want to find Mr. Lazarus chocolate bars on the shelf at their local store before they'll trust that it's worth their time, maybe. (I hear creator brands are pretty much everything right now?)
Yet, the fact that it's around, well maintained, and used in very impressive projects, still means a lot to those who are interested in what it can do.
And, I guess it still does some new stuff as needed. Pas2JS, webassembly, etc.
https://www.freepascal.org/~michael/pas2js-demos/wasienv/can...
And that's just thinking about fpc/Laz... There's much more to the Pascal world than this.
Fun fact: Double Command is a clone of Total Commander, itself also written in Pascal (the 32bit version is compiled using Delphi and the 64bit version using Free Pascal / Lazarus).
Also a somewhat popular archiving tool in recent years, peazip, is made in FPC / Lazarus too.
Wonder why those languages didn't get industry/FOSS adoption as much as Pascal did?