Live data from Hacker News

Internals of a Turbo Pascal Compiler

turbopascal.org

31–40 of 106 posts

Re: Internals of a Turbo Pascal Compiler

#31
post #4

This 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…

I have very fond memories of just how blazingly fast Turbo Pascal was at compiling on my Mac. It stunned me every time. I remember spending most of one summer writing a text adventure game with it, based in the Australian Gold Rush. It even had NPCs which was quite advanced for text adventures of the day (I think the only NPCs in adventure games that I had encountered up to that point were those in the Hobbit, and of…

Well you also had Apple's Object Pascal as the original OS system programming language, which was the inspiration for the OOP approach Turbo Pascal adopted.

With that one, you could surely do graphics programming on the Mac.

As for Turbo Pascal itself, I wasn't aware it was available on the Mac as well.

Re: Internals of a Turbo Pascal Compiler

#32

I 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…

> 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.

Re: Internals of a Turbo Pascal Compiler

#33
post #27
post #12

Turbo Pascal was my first contact with compiled languages in school, after starting off with Commodore Basic as a kid and graduating to Amos and some other Amiga stuff later. TP was my first contact with real PCs, too. After school I moved to Delphi, which was basically a thin wrapper around the Win32 API with Object Pascal syntax and the nicest IDE I had ever used (and probably will ever use). Delphi really paid my…

I think a lot of people would have claimed that the Amiga was the more powerful Personal Computer. In many ways, it was more interesting than the Mac or Windows computers. It simply didn't have the software support from Microsoft, for example. The Amiga did make its own dent in the universe: http://www.geek.com/games/cgi-first-introduced-to-tv-in-baby...

Absolutely, it took a long time until the games I made on my Amiga could be replicated on the PC. But by the time I was moving away from Amiga, it was clear that its time had passed.

Re: Internals of a Turbo Pascal Compiler

#34

I 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

Re: Internals of a Turbo Pascal Compiler

#35
post #34

I 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

haha wordstar v word perfect! haven't heard those words in ages...

Re: Internals of a Turbo Pascal Compiler

#36
post #4

This 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."

Re: Internals of a Turbo Pascal Compiler

#37
post #4

This 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…

Turbo Pascal was also available on CP/M (so 8080/Z80 8-bit). It was the most powerful language on Amstrad CPC 6128, the only 8-bit low cost computer to offer CP/M compatibility.

IIRC from the stories I heard, Anders retargeted the compiler to x86 in the course of a single weekend. I don't remember what it targeted first, but it wasn't x86; it might have been Z80, I don't recall.

Re: Internals of a Turbo Pascal Compiler

#38
post #9
post #4

This 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…

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

#39
post #32

I 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…

> 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 Pascal compilers: http://imgur.com/H6J12Dy

Re: Internals of a Turbo Pascal Compiler

#40
post #4

This 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…

I have very fond memories of just how blazingly fast Turbo Pascal was at compiling on my Mac. It stunned me every time. I remember spending most of one summer writing a text adventure game with it, based in the Australian Gold Rush. It even had NPCs which was quite advanced for text adventures of the day (I think the only NPCs in adventure games that I had encountered up to that point were those in the Hobbit, and of…

On DOS TP did support a texmode based "GUI".
Post reply on HN