Live data from Hacker News

Turbo Pascal Turns 40

blog.marcocantu.com

211–220 of 271 posts

Re: Turbo Pascal Turns 40

#211
When I first learned Turbo Pascal and later Delphi I thought we reached the peak productivity to create World-Class desktop programs and in the future there will be so many good desktop programs everybody creates because nothing came close to Delphi in my opinion.

Then the web came (and I got confused) and I've never regained such clarity in programming as with Delphi on my little Windows desktop.

Re: Turbo Pascal Turns 40

#212
post #7

Earlier quoted context omitted.

Same here. Even now, I still sometimes set my vim colors to blue background and yellow/white text.

That was a common choice for TUI software running in the 16-color PC textmode palette. I suppose the blue provided a "dark" background with less contrast than actual black. (TUI programs of the era generally had a pure black-and-white mode too, and the overall look there was not unlike that of *nix terminal-based software.)

I suspect it was in rather large measure because white on blue was the default for the DOS prompt in the early-mid eighties, and that in turn I always thought was because those were the colours of IBM's logo.

Re: Turbo Pascal Turns 40

#213
Turbo Pascal is probably the key thing that led me to end up studying CS and becoming a software engineer. I had dabbled in Basic starting around 10, I took a summer camp coding class, which would have been pretty novel in the late 80s I guess.

But then at some point we got a copy of Turbo Pascal (my Dad was an engineer and was always bringing interesting stuff home for me to try) and I started banging on that. In my senior year of HS I got super into it when I took another class. I did the whole year's curriculum in a couple months and then wrote an asteroids clone in class. It kind of drove the teacher nuts cause he said he had nothing left to teach me and he got annoyed when I started sharing the program with other students and they were playing the game instead of working.

The one thing I remember not grokking when using TP was pointers. I wrote my whole asteroids program with fixed size arrays. I don't think it helped that I didn't really have anything great in terms of books and no one around me really understood how to use them well to talk to me about it. A year later when I started learning C/C++ in college I got it quick though. I didn't even switch to CS till after I decided where to attend, I had originally planned on studying Aeronautical Engineering and the whole Turbo Pascal adventure made me change my mind.

I keep wondering if I have a copy of that program sitting on a floppy disk and I could recover it. I don't actually own a computer with a floppy drive though, even though I might have an old internal floppy drive sitting in a box.

Re: Turbo Pascal Turns 40

#215

Is anyone going to mentioned that that's not at all what Turbo Pascal looked like when it was first released? Not in 1983. The UI was significantly simpler. I remember it looking like this: https://imgur.com/EuOVL8c

I’m one year younger than TP, and the blue screen in TFA is the one I remember when I first used it (1990 or so I guess), so that must have been a later version.

Re: Turbo Pascal Turns 40

#216

I'm currently reading "Assembly Language Step-By-Step" by Jeff Duntemann from 1992. In it, he calls TP "moron friendly" (unlike Assembly). Also something like Sears Catalog fallacy, "where you go hunting through veritable Sears catalog of toolbox products looking like: SearchDataFileForFirstRecordBeginningWithStringAndDisplayInRed Basically, this method glues other people's canned procedures into programs..." 30 year…

Duntemann may be a great guy, but he definitely isn't and hasn't always been right.

Re: Turbo Pascal Turns 40

#217

Earlier quoted context omitted.

Yeah, the benefits of strong typing have nothing to do with Pascal... Sigh. Kids nowadays, etc. Look up which was the original language ridiculed for its "belt-and-braces" approach to type safety, in contrast to C, the freewheeling language of Kewl H4xx0rs (although they weren't yet spelled that way). Now excuse me, there's a cloud I have to go shake my fist at.

I genuinely didn't realize Pascal was recognized as providing having a strong type system. I guess there is Brian Kernighan's "Why Pascal is Not My Favorite Programming Language," where he complains that there's "no escape" to the type system as in C, where anything can be cast to anything. But I took it to mean that C just had an exceptionally loose and liberal type system.

Yah you have to think about this in the context of really bad C code from the 1990s.

It was really common for people to stuff pointers in ints and ints in pointers and do all kinds of really abusive things with the memory system in C. It was all fun and games until the program died with nary a stack trace. (Stack traces were pretty amazing the first time I saw them!)

There were even big commercial libraries that did really odd stuff. Motif (big early Unix UI framework) did a lot of weird stuff.

Pascal was pretty straightforward and disciplined compared to that, although I'm sure developers who were too clever for their own good found ways to do silly things.

Re: Turbo Pascal Turns 40

#218
post #194

For all who wonder why Turbo Pascal was so fast here some insights: 50% is certainly due to the language Pascal itself. Niklaus Wirth designed the language in a way so it can be compiled in a single pass. In general the design of Pascal is in my opinion truly elegant and compared to other programming languages completely underrated. Wirth published a tiny version of his compiler written in Pascal itself in a 1976 boo…

All of this is fascinating. I believe single-pass compilation is underrated, and quickly disregarded by a large body of the PL community as anachronistic. I think that's complete nonsense. Just take one look at the massive build infrastructure that's driving modern monorepos to see how incredibly crucial fast compile-times are. > Jump tables everywhere. In general the compiler was quite table driven. It would be inte…

Single-pass is a bit of a gimmick. It requires programs to be written sequentially in a strictly "bottom up" way, so that forward references to parts of the program that have yet to be defined are rare enough that they can be marked specially (e.g. as with C program headers).

It's also largely irrelevant if you want optimized code generation, especially across multiple procedures, since that requires you to read abstract representations of the code into memory and deal with them globally which is the opposite of single-pass compilation.

Re: Turbo Pascal Turns 40

#219

Earlier quoted context omitted.

All of this is fascinating. I believe single-pass compilation is underrated, and quickly disregarded by a large body of the PL community as anachronistic. I think that's complete nonsense. Just take one look at the massive build infrastructure that's driving modern monorepos to see how incredibly crucial fast compile-times are. > Jump tables everywhere. In general the compiler was quite table driven. It would be inte…

Single-pass is a bit of a gimmick. It requires programs to be written sequentially in a strictly "bottom up" way, so that forward references to parts of the program that have yet to be defined are rare enough that they can be marked specially (e.g. as with C program headers). It's also largely irrelevant if you want optimized code generation, especially across multiple procedures, since that requires you to read abst…

How often do you need highly optimized cg during development? Unless I'm working on games, 99.9% of my time (even on highly performance-critical software) is spent on evaluating debug builds with 0 perf requirements - because I need to implement it correctly first, and make sure tests are passing.

I think it's uncontroversial that most fast, statically compiled languages benefit greatly from quick debug builds. It's just that very few of them are designed with this in mind.

Re: Turbo Pascal Turns 40

#220

It's hard to overstate just how much faster Turbo Pascal was than its competitors. So fast that it was hard to believe it wasn't cheating in some way. And then the resulting program was faster too. A tour-de-force of its day, and it deserved all the acclimation that it got.

It's biggest downside was that it was limited to producing 64KB .COM files until version 4 or 5.

This is not TP compiler limit. It's format and memory model limit.

https://en.wikipedia.org/wiki/COM_file#DOS_binary_format

EXE (aka MZ) is using other memory models

https://devblogs.microsoft.com/oldnewthing/20200728-00/?p=10...

Post reply on HN