7 ms·
Pascal deserves a second look
- davikr 2y agoPascal's compilation time is still unparalleled in its speed and that is one of its greatest features.
- PaulHoule 2y agoTrue for Turbo. Not true for the truly atrocious UCSD Pascal. Computer scientists circa 1980 were driven absolutely crazy by BASIC becoming the dominant teaching language in primary schools; with alternatives like UCSD Pascal, however, you are better off writing assembly.
- romwell 2y agoPascal = Turbo Pascal if we're taking late 80s/early 90s. Everything else is blasphemy. After that, Pascal = Delphi (for quite a while). The fact that both are commercial, closed-source (and, in case of Delphi, quite pricey) packages is pretty much the sole reason Pascal lost out in popularity to languages that mere mortals could use at home without having to resort to piracy. It took Embarcadero over a decade to realize that offering a free "Community Edition" of the IDE is a must to stay relevant. It was too late by then.
- PaulHoule 2y agoSome people in the 1990s thought that open source, particularly the GNU suite, killed off the market for “cheap and cheerful” dev tools, thus we haven’t had a Borland ever since. Today innovation in programming tools tends to come from the hugest companies (Microsoft, Oracle, Google, Facebook) and even successful open source tools such as the LLVM-based compiler suite owe a lot to big funders like Apple. (Possibly Jetbrains is an exception, though my take is their attempts to introduce new languages like Katlin and radical frameworks like MPS haven’t been as impactful as getting the bugs and slowness out of Eclipse)
- peutetre 2y agoGo compiles fast: https://blog.howardjohn.info/posts/go-build-times/ https://blog.howardjohn.info/posts/go-build-times/
- anothername12 2y ago34000 lines of code/min on an 8088 fast?
- 082349872349872 2y agoMuch of that (potential) compilation speed is due to Wirth's personality, but his circumstances also helped. For industrial languages, programs will be compiled a few times while developing and debugging, and then run many, many more times in production. For a teaching language, programs will be compiled more than a few times while learning and debugging, and then run never. This situation has the corollary that teaching languages ought almost always to opt in favour of compilation speed over speed of compiled code. (when I started programming, developers shared a minicomputer CPU, which meant that even with Unix, which prioritises editor threads over compiler threads, ends of quarters were brutal for load average and hence system responsiveness)
- romwell 2y agoYou say this as if fast compilation speed somehow means bad performance. This is a false dichotomy. Pascal compiles fast and runs fast. Then there's the fact that performance of a program depends on far more things than the language it's written in — and faster iteration cycles ease optimization and profiling on the level of algorithms, which is where you have most gains. Squeezing that potential 3% speed up from using another language is rarely worth it then.
- deleted 2y ago[deleted]
- egypturnash 2y ago[flagged]
- PaulHoule 2y agoSadly, another case of YouTube sucking the brains out of the web. I'm much more inclined to read a blog post about Pascal than sit for an hour to listen to somebody yak.
- criddell 2y agoMaybe you have it backwards and the audience is actually on YouTube and not looking for blogs. If so, then it would be sad if this were a blog post and not a video. Maybe somebody who prefers blog posts to video will write an app that converts videos into blog posts. Seems like that should be doable with modern AI systems. Maybe it could even add and annotate images from the video. It would be an interesting feature for something like Instapaper.
- PaulHoule 2y agoFunny I was watching an Asmongold video where he was speculating that most people are functionally illiterate and literally can't read blog posts.
- criddell 2y agoSo the audience for blog posts might be even smaller than we think. If so, then a converter probably wouldn't get a lot of use.
- 7bit 2y agoThat's not speculation, that's just talking stupid shit.
- PaulHoule 2y agoSo is it that blogs are dead because Google doesn't surface them in search results anymore?
- PaulHoule 2y agoTurbo Pascal was in the running with assembly language for my favorite language to program the IBM PC in the 1980s. ISO Pascal didn't have the facilities to do systems programming, like trapping an interrupt, but Turbo Pascal did. Even BASIC had PEEK and POKE which are unsafe but let you target hardware registers. I fell out of the Pascal habit when I got to college because Turbo wasn't available for the Sun 68k and SPARC not to mention HP PA RISC workstations we had and soon I got my first 32-bit "home" computer and was using Linux so of course I switched to C, though I think mostly it was a step back.
- bbarn 2y agoThe last version of TP I used was I think 7? and it added in inline assembler. It was super nice for 14 year old me to learn assembly just enough to do the things TP couldn't do (like control a mouse on DOS). It was my gateway to a life of software development.
- PaulHoule 2y agoI used that a bit (absolutely great) but that was near the end of my TP career, for the most part I wrote library subroutines in assembly. For instance, the 8086 had a REP MOVS instruction that copies a block of bytes, the TP standard library used that for the copy data function. 80186 added REP MOVSW which would move 2 bytes at a time and be about two times faster on my 80286 machine. I had several replacements for library subroutines which took advantage of 80286 instructions to get much better performance.
- deleted 2y ago[deleted]
- pjmlp 2y agoInline Assembly was already on Turbo Pascal 4.
- bbarn 2y agoWell, prior to 7 I had the yellow one. 6? and no books or manuals, just some snippets from a Peter Norton book I got from the library enough times that the librarian asked me to not check it out for two weeks once. I got 7 for christmas and it came with the manual and maybe I mis-remember the difference between "added" and "I learned about it then"
- theodpHN 2y agoLong before Python and Java, there was $49.95 Turbo Pascal for DOS! https://en.wikipedia.org/wiki/Turbo_Pascal https://en.wikipedia.org/wiki/Turbo_Pascal
- pjmlp 2y agoWith a great TUI experience, that apparently is now so fashionable, as if modern computers couldn't do more than DOS. I loved Turbo Vision, but that was almost 40 years ago. We can do better.
- fp64 2y agoI always liked Pascal but apart from being “nicely structured and thus good for beginners” the article doesn’t convince me that I should use it again. Probably would use Ada instead anyways, as that has some really good ideas and I always got along with it
- notagoodidea 2y agoSame but in both case, I am not sure what to actually program with Ada every time I try to learn it again. I am a bit to used to web/data programming I guess.
- romwell 2y agoHow about "performs as fast as C++, compiles as fast as Java"?
- adamc 2y agoOne of the first languages I learned, along with Basic and PL1. But I bought a Mac, and, at the time, they were programmed in C.
- biesnecker 2y agoPascal was the language that AP Computer Science was taught in in the mid-90s when I took it. We used Turbo Pascal 6.0 for DOS, and I have fond memories. I think I'd still prefer C, but I appreciate the nostalgia.
- hvs 2y agoTurbo Pascal 6 was the first high-level language I learned after BASIC and my first job out of college was doing Delphi development. I loved programming in Pascal, not so much because of the syntax (it gets a bit clunky at times) but because of the speed and ease-of-use of the development environments. Similar to having a REPL in a language, fast compilation is amazingly helpful for development iteration. If you can test ideas quickly, you can reason about things more quickly (at least in my experience).
- ingen0s 2y ago[flagged]
- deleted 2y ago[deleted]
- jll29 2y agoI expected perhaps a reference to Brian W. Kernighan's excellent critique of Pascal from a systems programming perspective: https://www.lysator.liu.se/c/bwk-on-pascal.html https://www.lysator.liu.se/c/bwk-on-pascal.html I love Pascal's clarity, and enjoyed writing several years of Pascal and two years worth of Modula-2 in the 1980s and 1990s, but one has to admit Brian has some good points. If Pascal was still actively used by more people, a new version of its ISO standard could incorporate many things that "happened since" if the community so choose.
- pjmlp 2y agoThat version not only did exist, it was called ISO Extended Pascal, however by then Apple's and Borland's Object Pascal was what everyone cares about. That critic has nothing of excellent other than for UNIX heads. It ignores that for quite some time, outside UNIX, C only existed in various dialects of K&R C like Small-C, RatC, and whatever else was around on CP/M, competing mainframes and what not. Also ignores the existence of Modula-2, released three years prior to that rant.
- AnimalMuppet 2y agoThat wasn't a "rant", no matter how much it offends you. Here's what it actually was: Kernighan and Plaugher wrote a book called "Software Tools". The code in it was written in RATFOR, which is a preprocessor for FORTRAN. After that book was written, Kernighan got the idea of re-writing it using Pascal. And it was hard - much harder than he expected. So after he did so, he asked himself, "Why was that so hard? Pascal should have been much better than RATFOR, and it wasn't. Why not?" That's what the paper is about. (It's not even about C, so what C dialects existed, and where they existed, is completely irrelevant.) And the paper says that's what it's about. And, having used an ISO standard Pascal, every word of it is true. (The only exception was that we had separate compilation.) Almost everything he said, I ran into. The problems were real, and they were painful. Why didn't he use Modula-2? Because he didn't write the book in Modula-2. And why didn't he do that? He started the book in March 1980. Modula-2 probably had much less traction than Pascal at that time, so Pascal was a more reasonable language to pick for the book.
- JohnFen 2y agoPascal was the very first language I ever learned, way back in the 70s. I have a soft spot for it to this day. I wouldn't use it for a real project, though. It has meaningful problems and limitations that other languages don't have.
- TomMasz 2y agoPascal was my first "real" programming language and the language used in my CS undergrad. I even used it to develop for a bare metal 68000 system and a MicroPDP-11. But once I learned C and found how much easier it was to do embedded development, I left it behind. I have Lazarus and FreePascal and play with them now then, but it's more a nostalgia thing than anything else. I should probably try developing something useful with it one of these days.
- deleted 2y ago[deleted]
- cynicalsecurity 2y agoJust no.
- systems 2y agomy 2 cents we need a good free open source rad tools the rad market is dominated by very expensive commercial products, clarion, windev (pcsoft), outsystems , embarcadero, progress and few more pascal, give the impression of a potentially nice (could be) rad tool, that make easy things trivial and hard things possible, but i think in practice it is not really we need a nice foss rad devolpment environment, built around nicer and more modern languages , pascal is not a nice language , lazarus and other pascal ide are attractive though
- deleted 2y ago[deleted]
- tangus 2y agoIt doesn't deserve a second look. The only things Pascal has going for it nowadays are: (1) static executables and (2) some good libraries (and not many at that). As a language it's extremely primitive and unergonomic, and the Free Pascal maintainers don't really want to improve it because they are used to it. As an implementation, it's the slowest compiled language there is. Everything is heap allocated (and reallocated) and it doesn't even have an efficient allocator, not to mention garbage collector. The only reason there is to use Pascal nowadays is when you need one of the two things I mentioned and the results offset the torture that is programming in that language.
- anothername12 2y ago> As an implementation, it's the slowest compiled language there Are you talking about the Free Pascal implementation here?
- tangus 2y agoYes, but Delphi is no rocket either.
- wolvesechoes 2y ago"Everything is heap allocated" Well, the second look would prove it false, so maybe it is worth it after all.
- tangus 2y agoYeah, well... you won't get very far with just TP-style objects and strings and without dynamic arrays.
- BrandoElFollito 2y agoTurbo Pascal will always have a sweet spot in my heart, it was the first language I learned in my first year at the uni. I had a "Borland Turbo Pascal" book, a pirated TP and the IBM PC of my roommate. And a 8" disquette. In still see myself after all these years programming Convey ' game of life (the lines in the screen updated 1 line per second) and wondering at 4 am how I can add a disease or Godzilla crossing the ecosystem. Great memories.
- Jeema101 2y agoI recently ported an old Pascal game to Free Pascal. I had never really used Pascal before this particular project. Learning the language was interesting, but there's a lot about it that seemed pretty irritating, the main one being the separation of variable declarations and code (similar to the original C spec). It also took me way too long to figure out how to properly construct an 'if-then-else' block without the compiler complaining about the syntax. Can't say I would probably use it in a new project.
- igtztorrero 2y agoUse GoLang, it's better
- Fuhrmanator 2y agoAs a Mac developer (system 6, 7) in the late 80s, I always wrote in C. But Mac devs couldn't escape Pascal, because the many Mac OS functions (in the ROM) were from Pascal. You had to differentiate between C and Pascal strings, and you'd better well have declared that Mac OS call-back function in C with the 'pascal' keyword, lest you be shocked when your software crashes and you debug it in MacsBug to find the order of arguments is reversed on the stack! Doh! In the early 90s I coded lots in Modula 2 (for what it's Wirth) on Solaris, but never got much chance to do Pascal directly.