14 ms·
50 Years of Pascal
- mikewarot 6y agoOriginal seems to be down https://web.archive.org/web/20210223075835/https://cacm.acm.org/magazines/2021/3/250705-50-years-of-pascal/fulltext https://web.archive.org/web/20210223075835/https://cacm.acm....
- coliveira 6y agoPascal was the first language I learned in college. It is an excellent language for CS students, because it has clear syntax and it easy to figure out when something goes wrong (unlike C). Unfortunately it lost space to C and similar languages.
- bicolao 6y agoMy first too. The first time I looked at a C example it was soo cryptic! I wonder if we could compare the first time impression of C and Pascal though.
- vidarh 6y agoI once reverse-engineered a C program by compiling it and disassembling it, as I found it easier to read M68000 assembler.
- WalterBright 6y agoWirth's Pascal as described in User Manual and Report is nearly impossible to write non-trivial programs in. I know, I tried. It required a lot of extensions to become usable. In 1982 or so a friend loaned me his copy of K+R, I read it, and was instantly hooked. Never wrote another line of Pascal. I had written a lot of PDP-11 assembler at the time, and C's PDP-11 heritage made it very easy to pick up C. I saw how the PDP-11's semantics mapped right on to C. But some good came out of my experience with Pascal. D's nested functions are inspired by Pascal's nested functions. Simple and easy, including the ability to reach back on the stack and access the callers's variables (all the way up to main()). C should have had nested functions.
- badsectoracula 6y agoAnd typesafe enums and sets of said enums and ranges of ints and enums and arrays addressable by said ranges and the ability to pass values by reference to functions :-P
- rootbear 6y agoAgree on nested functions. Gcc has them as an extension but the last time I looked, clang did not. A pity.
- notacoward 6y agoThere are also some pitfalls in gcc's implementation. On one project we found that nested functions used as callbacks didn't play well with green threads, and it was a pain to deal with.
- raister 6y agoThe only thing I disliked was the `begin ... end` and the `begin ... end;` (notice the semicolon) structure on if-then-else C (and many others) has simplified employing brackets.
- andi999 6y agoSo you never tried to write a function that accepts strings with different length?
- raister 6y agoThis was 'solved' with pointers, didn't? (symbol ^) Well, we're talking about at least 25 years ago, so I clearly not remember this hiccup whatsoever
- andi999 6y agoTurbo Pascal didnt have that hiccup, only the original language.
- badsectoracula 6y agoYou can work around this - Turbo Pascal's strings are essentially syntax sugar for type string = record Length: Byte; Chars: array [1..255] of Char end; You can use this to make your own string handling procedures, the hardest part would be passing arbitrary string literals but that could probably worked around too with conversion functions.
- peter303 6y agoC and C++ were free. Free crap often wins over purchased quality.
- hojjat12000 6y agoC was ported to any platform. Free crap (when it comes to programming languages) win, because they can be used everywhere therefore a better thing to learn. For example, Borland never opened the sources of the compiler, and Turbo Pascal has never been ported to platforms other than DOS/Windows. Free crap in other areas (such as computer graphics) did not win over purchased quality. For example graphics designers even choose their Operating System based on available (non-free) quality software.
- badsectoracula 6y agoDelphi was ported to Linux with Kylix (using Qt as a backend for the GUI) but didn't saw much use. However the issue with Delphi was really that Borland got greedy around the turn of the century, started chasing enterprises and jacked up the prices considerably. Turbo Pascal originally costed less than a game yet you got both one of the best compilers and a book to learn from and Delphi until around 5 or 6 or so (do not remember the exact version) could be bought for around $99 at its cheapest version (AFAIK upgrade was cheaper) which was still affordable even by highschool students and provided a very high quality package. And during the 90s Borland Pascal and Delphi had a TON of mindshare - something they lost as they moved away from being affordable to everyone. People wouldn't mind much if Delphi wasn't free as long as it was still affordable to everyone and good quality. Sadly not only it became unaffordable to the most important segment of programmers (the new ones who want to experiment with stuff) but it also degraded in quality.
- AnimalMuppet 6y agoCrap that works wins over stuff that sounds good in theory. If you ever had to work with an as-defined-by-Wirth Pascal, it was painful. Another data point: Turbo C wasn't free, either. How did it sell compared to Turbo Pascal? (I don't actually know; does anyone have data?)
- 6y ago
- RcouF1uZ4gsC 6y agoI think the three greatest living language designers are Niklaus Wirth, Anders Hejlsberg, and Bjarne Stroustrup. Pascal definitely had a huge impact on programming, especially through Borland Turbo Pascal on the PC. I think Pascal's biggest weakness was that there was not a central figure helping guide evolution in a backwards compatible way. Wirth did a great job with Pascal, but moved on to what were to him greener pastures such as Modula-2/3 and Oberon, but which did not have nearly the impact of Pascal.
- pjmlp 6y agoWirth repents this himself, he though, like many of us, that developers care about quality and it would be obvious for them to adopt such languages. Problem is this kind of programing languages go against the UNIX culture of move fast and break things, with considers them programming with a straight jacket. So here we are fixing memory corruption issues, with hardware and OS vendors bringging back hardware tagged memory ideas from Lisp Machines to fix C machines. "A Brief History of Software Engineering" https://people.inf.ethz.ch/wirth/Miscellaneous/IEEE-Annals.pdf https://people.inf.ethz.ch/wirth/Miscellaneous/IEEE-Annals.p...
- mhd 6y agoProgramming philosophy is an interesting thing, and I don't think it's just a dichotomy. Wirth does have some things in common with the Bell Labs crowd and doesn't quite fit in the same niche as Dijkstra-esque Ivory Tower designs or very sound and secure computational mega-structures. Not a fan of functional programming, for one. I think one quality of software engineering he would disagree is the "move fast and add things" we're so enamored of. Nothing is every removed and because everything is treated like a product, you have to add new features to "sell" something, including programming languages. The "straight jacket" comment is interesting. I remember reading the "jargon file" that came with my slackware CD in the 90s and being quite pumped about the "punk" nature of the Unix crowd opposing "bondage and discipline" languages. A few years later, the same crowd of people forbids tabs in their C-clone or even has official formatting rules enforced via mandatory pretty printing.
- patrec 6y ago
- yawaramin 6y agoInteresting history, from Wirth's perspective. A little strange though that he mentioned Java and C# as inheriting the legacy of Pascal, but left out Delphi, through which C# indirectly inherits from Pascal. FreePascal is also worth mentioning but perhaps not academically very interesting. Other, more modern, languages that come to mind as inheriting from Pascal are Go and OCaml. OCaml more directly inherits from Modula-2's notion of separate interface and implementation, and gains similar parallel compilation speed benefits from that: https://dev.to/yawaramin/ocaml-interface-files-hero-or-menace-2cib https://dev.to/yawaramin/ocaml-interface-files-hero-or-menac... If you look at the imperative and some other parts of OCaml, the Pascal heritage is clear, e.g. comments (* ... *), for loop, while loop, mutable assignment with x := y, etc.
- pjmlp 6y agoDelphi is a transition point between Pascal and C#, so. In any case, I bet he wasn't that found of Delphi. You will also not find much love from him on the Oberon descendants, namely Oberon-2, Active Oberon, Oberon.NET, Zonnon, Component Pascal. Modula-2 isn't that much big influence on OCaml, its modular ideas were already present in CLU, ML and Mesa. Also OCaml, is actually Objective Caml, back when I was in the university Caml Ligth was still their stable ML implementation, with Objective Caml being released a couple of years later.
- yakubin 6y ago> Modula-2 isn't that much big influence on OCaml, its modular ideas were already present in CLU, ML and Mesa. Modula inspired ML in this regard: <https://dl.acm.org/doi/10.1145/773473.178245 https://dl.acm.org/doi/10.1145/773473.178245> ML modules alone don't provide separate compilation.
- pjmlp 6y agoI stand corrected, thanks for pointing out the paper.
- davidhbolton 6y ago
- d_silin 6y agoI definitely enjoyed learning and using Pascal and Delphi. The language made so much sense! The code was structured, disciplined, easy to follow. I get the verbosity may not be for everyone, but it also made it much easier to read. Delphi was also out of everyone's league for application development, and not just basic "forms + DB" apps. Here is a full-scale Civilization game clone written in Delphi: http://www.c-evo.org http://www.c-evo.org (I did write a mod for that game, but I was not the core dev)
- pjmlp 6y agoHappy Birthday Pascal! Thanks for teaching me almost safe systems programming with your dialects and descendants.
- keithnz 6y agoA lot of my early formal learning was using Turbo Pascal circa 1990. it was a really nice language to learn in. Very easy.
- Aldipower 6y agoSame here, although 5 years later. I've learned static typing, byte handling, string handling, array handling, arguments by reference !, arguments by copy and even OOP with it. It was very easy to read and well structured. Clearly structured but powerful learning language at this time.
- neovive 6y agoSame for me as well. In school, we started with GW-BASIC and moved to Turbo Pascal. Pascal was a great learning language and the fundamental concepts I learned in Pascal translated very well to other languages. Looking back, I didn't even realize there's a difference between Turbo Pascal and official Pascal. The Turbo Pascal IDE is all we knew and it worked very well on those IBM PC's.
- elcritch 6y agoNim despite having Python like syntax inherits much from Pascal. It was even originally written in FreePascal [1]! I've come to appreciate `var` and `let` blocks in Nim that I believe come from Pascal syntax: let mnist = load_mnist(cache = true) # Training data is 60k 28x28 greyscale images from 0-255 # Change shape from [N, H, W] to [N, C, H, W], with C = 1 (unsqueeze). Convolution expect 4d tensors X_train = ctx.variable x_train.unsqueeze(1) ... However unlike Pascal syntaxes (and Ada), Nim remains less verbose and feels less "straight jacketed" for it. It's odd but while it encourages safer code than C its doesn't feel quite as stifling. You can do most any pointer manipulations you might need, but using builtin functions (i.e. `addr` or `unsafeAddr`) rather than symbol operators. 1: https://news.ycombinator.com/item?id=25242926 https://news.ycombinator.com/item?id=25242926 2: https://github.com/mratsim/Arraymancer/blob/master/examples/ex02_handwritten_digits_recognition.nim https://github.com/mratsim/Arraymancer/blob/master/examples/...
- pdw 6y agoThat's more likely copied from the functional programming world (ML / Miranda / Haskell). And they got it from Lisp's "let" form. Wirth's languages always had a very strict separation between variable declarations and code. Your example might look something like this in Pascal: PROCEDURE foo; VAR mnist: MNistRecord; x_train: XTrainRecord; BEGIN mnist := load_mnist(true); ...
- linuxlizard 6y agoWas hoping someone would mention Ada. It's the most Pascal-y of all Pascal's children. I enjoyed my brief time doing Ada. I should look at Nim.
- Jtsummers 6y agoIf it's been a while, SPARK/Ada has been interesting to play with. No real objective for me since work won't touch it, but it's been interesting playing with the prover and design-by-contract elements of it. It's more properly integrated (with Ada 2012) than the prior versions.
- groundCode 6y agoPascal was the first language I learned. I don’t remember my ch of it but I always liked := for variable assignment
- kenver 6y agoSame as me. I really liked that too. I always read it as x becomes equal to y.
- ngcc_hk 6y agoAt least it is not “equal” which is conceptually confusing in many other languages .
- raister 6y agoThe sheer amount of bugs that could be avoided by using := in let's say C! if (a = b) c=1; oh boy... :)
- AnimalMuppet 6y agoI disliked it. Assignment happens more often than comparison, so it makes sense for assignment to have the shorter symbol (Shannon would agree). := may make more sense for students, but maybe not for professional programmers. Then I injured a the little finger on my left hand. And then I loathed :=, because I had to get to the left shift key to type the :, over and over and over, and I couldn't use my left little finger to do it. (If you're a professional programmer, you may not think of yourself as a person who works with your hands, but you do.)
- tralarpa 6y agoI think the article at https://people.inf.ethz.ch/wirth/Miscellaneous/IEEE-Annals.pdf https://people.inf.ethz.ch/wirth/Miscellaneous/IEEE-Annals.p... is even more interesting (thanks to user pjmlp).
- pulse7 6y agoIf Niklaus Wirth is reading this: Thank you for all your work on Pascal, Modula and Oberon! I would especially like to thank you for your work on "drastic simplifications and consolidations" - to reduce complexity and make it easy to use!
- davidhbolton 6y agoNot quite a billion dollar mistake (like null in other languages) but the with statement in Pascal was on reflection a big mistake. I have wasted a day trying to untangle some code that was blown up when I removed a with statement. Unfortunately it didn't completely cause compilation errors but in a few cases linked in the wrong thing and totally misbehaved at runtime.
- RicoElectrico 6y agoCountless generations of Polish high school students were taught Pascal as their first programming language, either in Turbo Pascal or Free Pascal. As per how useful it is to teach a language that has been niche since 20+ years, I can't tell. But the other common alternative was C++ in Dev-C++ or Code::Blocks, albeit most used books focus on the ancient practices, not even in line with C++11. People learn from Grębosz's "Symfonia C++" to this day, which is way outdated. Currently, I guess the easiest choice to teach would be Python (and actually a usefull skill for the students), but not being a statically typed language kind of takes away educational value you can milk from it without introducing another language.
- TargetedVictimm 6y agoThe crypto anarchists have been trying to kill me for 3 years now. They have been gangstalking me and trying to drive me to suicide. F Elon Musk F Barry Silbert NEMESIS
- Bluestein 6y agoAh! A first language, kind of like a first love! :)
- drfuchs 6y agoPascal, as defined by Wirth, is just horrible. No "fopen" to open files of a given name in the filesystem. In fact, no "open/creat", nor any other system calls at all. No "extern", no "#include", no user-created libraries, no ability to create a .a file, or even a .o file without main(). Actually, no system libraries, either; just a few built-in functions (sin and cos, but no tan; ln but no log). No "default" on case statements. No "break" or "continue" statements; only "goto". No bitwise operators for and/or/xor. No equivalent of C's && and || operators, where the second argument is guaranteed not to be evaluated if the first one determines the result. And, for everyone who complains about C strings, all Wirth Pascal strings are fixed-length arrays of characters. So, you can't pass the constant string 'foo' to a function that is expecting an array of 4 characters. Finally, in TeX, Knuth says he found the fact that when you get around to defining a forward function, you must NOT repeat the parameter list (names, types) again, to be so objectionable that he chose to use global variables to communicate with forward functions instead. All of people's fond Pascal memories are actually due to extensions in Turbo Pascal, etc.
- drfuchs 6y ago... and a few more: You can convert enum->int, but you can't go the other way. All text input files must have eoln() defined at all times, so if an when you manage to open stdin, the program must halt until the user types a line of input (and eoln() will be true iff it's empty). Then when your program reads the line and the \n, everything halts until the user types the next line of input. It's virtually impossible to make a program that interacts with the user. And if I had a nickel for every time a student got stymied by the fact that the syntax insists you must not have a semi-colon in front of an "else"....
- andi999 6y agoThanks. What also ticks me off is that he isn't eating his own food, you cannot write the writeln function is pascal (even the function doing nothing), since you would need a variadic function which accepts strings of different length, both two big no nos.
- badsectoracula 6y ago
- open-source-ux 6y ago"No reference to any computer or mechanism should be necessary to understand it." I share the sentiment, but even Oberon has pointers. It's also a strongly typed programming language. You could argue that types are a way of mapping how computers represent data (inseparable from the advantages of type checking in program design). For example, you don't simply declare an integer in some languages, you declare it as 8-, 16-, 32- or 64-bit integer. And many compiled languages have specific memory-related syntax. Although I prefer strongly typed programming languages, it's actually dynamic languages that have shielded programmers (for better or worse) from types, pointers and manual memory manipulation. Without the need to expose computer workings, it's dynamic languages that fulfil the sentiment in Wirth's statement, much more than strongly typed languages.
- pjmlp 6y agoDepends on the dynamic language, Common Lisp can be used to write full stack OSes. Python also exposes pointers and manual memory manipulation via ctypes package.
- MarcusE1W 6y agoI think Ada get’s quite close to that approach. Mostly you describe data structures you need, rather a representation the computer understands. The compiler is supposed to sort out the transition from programmer need to computer need. E.g. type Day_Type is range 1 .. 31; type Integ_Type is digits 5 range -1.0 .. 1.0; The compiler then chooses the best representation.
- benibela 6y agoI did most of my programming in Delphi when I was a kid. Unfortunately, I then got stuck on it. Any other language is either too slow or too unsafe. Nowadays, I mostly use FreePascal, because so many people refuse to use non-open-source software, but FreePascal never caught up to Delphi. And there is no open-source ecosystem, probably because there is no standard package manager. Even if there are Pascal libraries, it is hard to find them or they become quickly unmaintained, so it is more economic to write everything myself. And then I could not find a job because no one is searching for Delphi programmers
- badsectoracula 6y agoWhere do you think Free Pascal hasn't caught up to Delphi? AFAIK they're more the less the same with the main thing missing from Free Pascal is anonymous functions (they're in a separate branch though and will be added at some point "soon") and inline variable declarations (which wont be added because the Free Pascal developers feel that they aren't "Pascal-ish"). BTW Lazarus does have a package manager, just make sure you have the 'onlinepackagemanager' package installed in the IDE (should be installed by default with Windows installations but you may need to explicitly install it if you build from source).
- benibela 6y ago>inline variable declarations (which wont be added because the Free Pascal developers feel that they aren't "Pascal-ish"). That is the big one And just in quality. FPC compiles slower or even crashes during compiling. Debugging is worse with gdb. On Linux it uses longjmp exception handling which is rather slow. It tries to warn about uninitialized variables, but does not track properly which ones are initialized >BTW Lazarus does have a package manager, just make sure you have the 'onlinepackagemanager' package installed in the IDE (should be installed by default with Windows installations but you may need to explicitly install it if you build from source). Lazarus is not FreePascal. They only include libraries that are Lazarus Packages (with an *.lpk file), and I use libraries that do not have one On the other hand, I used Lazarus (only LCL and lazbuild) is another project, and tried to submit it to an open-source app store, and they refused it, because they would not install Lazarus, because Lazarus was an IDE. Freepascal actually has a package manager, too: https://fppkg.cnoc.nl/ https://fppkg.cnoc.nl/ But it is not advertised, so there are even less libraries on it Anyways, what is missing is a single command line call that installs all dependencies I used in my projects. And these dependencies are neither in opm nor fppkg
- Bostonian 6y agoThe Pascal critics may like "Why Pascal is Not My Favorite Programming Language" by Brian W. Kernighan, April 2, 1981 http://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pascal.html http://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pasc...
- AnimalMuppet 6y agoWhich, despite the author, is not a comparison of C and Pascal. The backstory is that Kernighan wrote (with Plaugher) a book called "Software Tools". They wrote it in RATFOR, which is a front-end for FORTRAN. They wrote significant chunks of code - not just examples. Some time later, Kernighan got the idea to re-write the book using Pascal - a much more modern, easy-to-use language. And after doing so, he wondered "Why was that so hard? Pascal should be way easier to write in than RATFOR." And he wrote this paper, analyzing why it was hard to write Software Tools in Pascal.
- fpoling 6y agoAs a student I learned Turbo Pascal around 1991. Most of the problems with the original language were fixed and Borland provided enough extensions to use the language to program hardware drivers under DOS. Then on my first job I learned C++, again in its Borland incarnation. The slow compilation speed was a big issue. We were forced to use carefully structured precompiled headers and tried not to touch headers included in the core compilation set. And all that after very fast compilation and linking even on big projects with Turbo Pascal. There was even discussion to switch the project to Pascal to be more productive. But C++ were considered cooler and we stayed with it. And at my current work almost 30 years later I still have to wait hours for full recompilation to finish. C++ modules that do roughly what Turbo Pascal had with its unit files are supposed to fix that, but we are still few years from using that in production.
- coldcode 6y agoI bought a copy of Turbo Pascal from the Borland booth at the West Coast Computer Fair in 1983 (or 4?). It was amazing product to use; it might be looking at so many years hence, but it still feel like no programming system ever could match the speed. While I do Swift today, I still remember how much fun it was to do Pascal almost instantly.
- cobaltoxide 6y agoEvery aspect of the system was fast. I particularly liked the lightning-fast "hypertext" online help. A single keypress would instantly bring up reference documentation for the language and libraries.
- rightbyte 6y agoWow ... once every 2nd year I try to add that basic feuture to my workflow IDEs but give up each time. The function signature is ofent not enough. Tooling has really degraded.
- badsectoracula 6y agoIt is largely because unlike Borland's products, nowadays there isn't a single source that provides everything and tools are really made up from barely (if at all) related components. In some cases where tools are made up for each other you have better integration - e.g. Free Pascal's own IDE does have online help like Turbo Pascal (though a downside is that because the help is in CHM, i.e. HTML, the formatting in the text mode IDE sometimes doesn't look that good - but the documentation is there anyway).
- cpascal 6y agoPascal was the first language where programming clicked for me. Pascal also happens to be my given last name, which makes it just a bit more special to me. Funnily enough I learned Pascal using Turbo Pascal which makes me sound older than I am, because I learned Pascal around 2010 and my high school's CS department was just way behind the times. By that point we were using a nearly 20 year-old 16 bit compiler in Windows XP.
- badsectoracula 6y agoI always find weird when schools use Turbo Pascal instead of Free Pascal considering Free Pascal's IDE looks pretty much the same as Turbo Pascal 7 but also works on in any OS.
- vram22 6y agoInertia and/or lack of knowledge, likely. There are colleges in India which even today use Turbo C (maybe v2.0) as the tool to teach C, for example, even though there are things like Bloodshed Dev-C++ and GCC - GCC even on Windows via probably Cygwin, MinGW, or WSL (not checked if GCC works on all those, think I have seen it on 1 or 2 of them).
- Wildgoose 6y agoThe thing I most miss in modern languages is that unlike Pascal they don't automatically include a built-in Set type, (typically using fast bitmap arithmetic).
- sgadimbayli 6y agoGood old memories. Circa 2006-2008 Azerbaijan. College students used to attend competitions, mostly ACM like questions, solved on paper. Only finals were solved using computers. Most of us used Delphi later on, but dumped quickly. Need to check what's happening in Delphi scene.
- zwieback 6y agoI used the P-code based UCSD Pascal on my Apple ][+ and it was pretty interesting, you could even compile Fortran to run on the virtual P machine. However, when I got my hands on Turbo Pascal it was one of those eye-opening moments I'll never forget. It was such a smooth experience, I couldn't believe it was running on my dinky 8 bit computer, although it was a bit sad it was running on the Z80 and not the 6502, the best microprocessor of all times, ever.
- vram22 6y agoI too loved programming on the 6502 processor. I did a fair amount of assembly language programming on micros that had it, like the BBC micro and Commodore 64, very early, when learning programming. I liked its instruction set, with all those addressing modes, such as indirect indexed or vice versa. Later when I learned a bit of 8088/8086 assembly, the latter seemed more complex, with its segment:offset format of specifying addresses.
- musicale 6y agoNiklaus Wirth is a huge inspiration to me. I'm particularly struck by the compactness and internal simplicity of the Oberon system, as well as its associated hardware, Wirth's simple RISC (not to be confused with RISC-V) architecture implemented in the LoLa HDL.