I loved Turbo Pascal. When I got to learn C, already had Turbo Pascal 3, 4, 5.5 and 6.0 on my toolbox. Compared with Turbo Pascal, the only thing C had going for it was being available in other systems. Everything else was meh. No memory safe handling, no bounds checking, no units (modules), no namespacing, no proper strings, no OOP support, arrays decaying into pointers, no type safe enumerations, no sets, no generi…
Pascal was off time. A lot of these traits are really worthy, but it wasn't attractive at the time .. was it as 'performant' as C too or was it a very nice environment to craft sound code productively whereas C code could allow you to tap into hardware more aggressively no matter how much headaches that would give you ?
Internals of a Turbo Pascal Compiler
41–50 of 106 posts
Re: Internals of a Turbo Pascal Compiler
#42This site doesn't describe the internals of Borland's Turbo Pascal compiler. It describes a compiler written in Turbo Pascal that can compile some subset of Turbo Pascal's language. Borland's Turbo Pascal compiler was written in 16-bit x86 assembly, mostly by Anders Hejlsberg. There is an explanation of this on the front page of the site, but it's not clear from the headline. (I used to work at Borland on the Delphi…
According to the author, it is not just a subset and actually produces the same binary files as actual TP would (with the exception of debug info). I can't currently verify that claim, but here's what he says on the downloads page: "It can compile any source code compatible with Turbo Pascal 7 syntax. It will generate the same executable file and unit files as the original Borland compiler."
Turbo Pascal was a much smaller language than what Delphi became, so I can't point you out examples off the top of my head. If I were looking into compatibility issues, I'd play around with things like alignment and packing rules, TP's various hacks to get around Standard Pascal's fixed length strings (e.g. OpenString {$P+}), etc.
Re: Internals of a Turbo Pascal Compiler
#43This site doesn't describe the internals of Borland's Turbo Pascal compiler. It describes a compiler written in Turbo Pascal that can compile some subset of Turbo Pascal's language. Borland's Turbo Pascal compiler was written in 16-bit x86 assembly, mostly by Anders Hejlsberg. There is an explanation of this on the front page of the site, but it's not clear from the headline. (I used to work at Borland on the Delphi…
According to the author, it is not just a subset and actually produces the same binary files as actual TP would (with the exception of debug info). I can't currently verify that claim, but here's what he says on the downloads page: "It can compile any source code compatible with Turbo Pascal 7 syntax. It will generate the same executable file and unit files as the original Borland compiler."
Interestingly, in 3.0, it will support compiling JVM byte code. [1]
[1] http://wiki.freepascal.org/FPC_New_Features_3.0#Support_for_...
Re: Internals of a Turbo Pascal Compiler
#44I loved Turbo Pascal. When I got to learn C, already had Turbo Pascal 3, 4, 5.5 and 6.0 on my toolbox. Compared with Turbo Pascal, the only thing C had going for it was being available in other systems. Everything else was meh. No memory safe handling, no bounds checking, no units (modules), no namespacing, no proper strings, no OOP support, arrays decaying into pointers, no type safe enumerations, no sets, no generi…
Re: Internals of a Turbo Pascal Compiler
#45This site doesn't describe the internals of Borland's Turbo Pascal compiler. It describes a compiler written in Turbo Pascal that can compile some subset of Turbo Pascal's language. Borland's Turbo Pascal compiler was written in 16-bit x86 assembly, mostly by Anders Hejlsberg. There is an explanation of this on the front page of the site, but it's not clear from the headline. (I used to work at Borland on the Delphi…
.. thats the story I was hoping to read, and have been waiting for, for many years. I went from the necessity of A86 assembler, thru the desperation of GW-Basic .. finally finding Turbo Pascal, which was a revelation at the time, just this phenomenal product and superb piece of engineering. Pulldown text menus, draggable text windows, editor out of the box .. fast compilation, wow - to me its one of the great monumen…
I stuck with TP through version 5, and even convinced my college teachers to let me use it for my programming assignments rather than whatever was on the college mainframe.
The manuals were indeed a huge asset. You didn't really need to know anything about the OS, or go digging for third party documentation online, which was important because there was no online.
Re: Internals of a Turbo Pascal Compiler
#46Earlier quoted context omitted.
> the only 8-bit low cost computer to offer CP/M compatibility. The Commodore 128 also offered CP/M compatibility (through a second CPU...), though rarely used.
All MSX could run CP/M, but this was somehow not much known.
On CPC6128 the disk drive was standard (and yes, it was that strange 3" variant, not using the 3.5" disks that would later be known as the "3D model of the save icon".)
Re: Internals of a Turbo Pascal Compiler
#47I was working at a software store during the mid-late 80's (Babbages if anyone knows it) and had a customer come in asking for a small, lightweight editor... You know like "turbo pascal but w/o the compiler part". First time I ever heard of it and, tbh, had no idea what he was talking about. I later used it to do some work for in my CS class (highschool was teaching programming via Pascal). It's a good language to le…
> Didn't it also have some quick key combinations (I recall a ctrl+k for some reason but I'm sure it's just memory...) Exactly. So-called WordStar combinations, which lot of the editors of the time were using. AFAIK, it is still used on some quite popular text editors on Linux (joe?). https://en.wikipedia.org/wiki/WordStar
"jstar" version of JOE has the WordStar keys.
Re: Internals of a Turbo Pascal Compiler
#48Earlier quoted context omitted.
> the only 8-bit low cost computer to offer CP/M compatibility. The Commodore 128 also offered CP/M compatibility (through a second CPU...), though rarely used.
You're right, in Europe the Amstrad was less expensive than the Commodore and hence far more popular. The CPC 6128 was probably at this time the less expensive computer to run Turbo Pascal. The Apple II has an optional Z80 card, but the total price was not for everyone, at least in Europe.
Amstrad also sold far less than C128. The whole Amstrad CPC line sold about 3 million vs 5 million C128's. I don't know the breakdown between the Amstrad CPC models, but I'd bet a substantial percentage of that was the 464.
I'm sure the Amstrads were more common for CP/M, though. Of the few people I knew with C128's, most used it as a glorified C64, and nobody used the CP/M mode.
(Incidentally you could also get CP/M support for C64 through a cartridge that housed a Z80...)
Re: Internals of a Turbo Pascal Compiler
#49Earlier quoted context omitted.
.. thats the story I was hoping to read, and have been waiting for, for many years. I went from the necessity of A86 assembler, thru the desperation of GW-Basic .. finally finding Turbo Pascal, which was a revelation at the time, just this phenomenal product and superb piece of engineering. Pulldown text menus, draggable text windows, editor out of the box .. fast compilation, wow - to me its one of the great monumen…
Desperation of GW-Basic?! Be glad you had that one. The other BASICs of those times where much more limited! GW was a little bit of awesome in it's own way. Oh, and POKE and PEEK.
Re: Internals of a Turbo Pascal Compiler
#50Earlier quoted context omitted.
> IIRC correctly, TP used a yellow font (well ascii) on a black background (default)? Only Turbo Pascal 3.0, afterwards the IDE had other colors.
Turbo Pascal 2.0 had the yellow/black scheme as seen here: http://imgur.com/utFhJag Turbo C always had the more complex IDE, which Turbo Pascal didn't get until 4.0: http://imgur.com/kYjwuPA That environment used the Turbo Vision library, and it was later ported to DJGPP and also Linux, there's an editor called RHIDE which uses it. Microsoft used their own IDE in products like QBasic, edit.com, as well as their C and…
Turbo Pascal 4.0 through 5.5's IDEs were, TTBOMK, not based on Turbo Vision.