[fpc-devel] On recasting BORLAND PASCAL FROM SQUARE ONE for Free Pascal

Daniël Mantione daniel.mantione at freepascal.org
Mon Jan 7 01:06:12 CET 2008

Op Sun, 6 Jan 2008, schreef Jeff Duntemann:

> Hi everybody--
> I figured I would introduce myself, having just signed on to the list here. 
> Some of you may already know me and my work. I've been a Pascal fanatic since 
> I discovered the language in 1978 and wrote heavily about it for many years. 
> I wrote COMPLETE TURBO PASCAL in 1985 and kept it current for eight years, 
> until 1993.

I read the Dutch translation "Turbo Pascal compleet" when I was 16 years 
old. I learnt basics of the language about year earlier and my big project 
was learning how to program the Sound Blaster. "Turbo Pascal compleet" was 
exactly what I needed, together with Peter Norton's famous book on x86 
assembly language. Nice thing about TPC it was the only book that 
contained some info about TP's calling conventions which was exactly the 
knowledge I needed for my Soundblaster project (which was mixed 
Pascal/asm). So, I read the book top to bottom.

> At that point Delphi was well underway, and I moved most of my 
> efforts there. The last edition of COMPLETE TURBO PASCAL had to be renamed 
> for a couple of reasons, and it became BORLAND PASCAL FROM SQUARE ONE, 
> focusing on BP7. That edition was published in 1993, but the publisher was 
> shut down in a merger that same year, and few of the books that were printed 
> were actually sold.
> I've been trying to figure out what to do with the book since that time. (All 
> rights reverted to me long ago.) Recently Anthony Henry suggested something 
> that I had thought of a couple of years ago: Recasting the book for Free 
> Pascal. Time permitting, that's what I intend to do.  I was paid fairly well 
> for the book in 1992, so I'm going to release it under Creative Commons, 
> which is a sort of GPL for textual material. The ebook PDF will be free, and 
> I'll post the PDF on Lulu.com so that people can order printed copies if they 
> prefer to read a paper book. Those printed copies won't be free, obviously, 
> but they won't be expensive, either. (I won't know how expensive until I 
> recast the book, as the cost to print a copy varies linearly with the page 
> count.)

Sounds very nice! Good introduction books in Pascal are rather rare 
nowadays; and I see a lot of demand for them in the community.

> I've had Free Pascal installed on a corner of my hard drive for five or six 
> years now, and although I haven't written anything ambitious in it, I've 
> loaded and compiled a bit of the old Pascal code that I've had lying around 
> for 25 years. I haven't explored it completely, but I'll get back to it and 
> exercise a lot more of it in coming months.
> Here are a few issues that I'd like some advice on:
> 1. The book is quite large, at 810 pages. To make a printed book on Lulu that 
> won't fall apart after one reading, the length has to be *much* less than 
> that. I'm thinking of cutting it up into a couple of shorter books. The first 
> book will be purely an introduction to the Pascal language, and will go as 
> far as locality and scope. (If anyone here has the original printed book, 
> that would be up to about page 300.) A second book will take it from there, 
> and go into a lot more depth about separate compilation, disk I/O, debugging, 
> linked lists and so on. There may be enough material for a third book, 
> depending on how I cut it and how much I will simply delete--coverage of 
> overlays, for example. I really need to keep the length of a single book down 
> to about 300 pages. Since the ebooks will be free, this shouldn't be a 
> problem.

If I remember well, the original book was already split in an introduction 
and an advanced topics part, which can indeed very well become separate 

> 2. I need to know what platform to base the book on. It's now a DOS book, and 
> I can easily recast it for work in a console window under Windows. However, I 
> suspect that more people use it under Linux. Would basing it on Linux (using 
> text mode in a terminal window) be better?

Both platforms exist and are a significant part of the FPC users. I don't 
think it is a good idea to choose for one platform and ignore the other. I 
don't think you need to either, since basic functionality, like the dos, 
sysutils, crt, etc. units work on all platforms. All you have to do is to 
introduce people the difference in file names (i.e. c:\fpc versus 
/usr/local/lib/fpc), and how they can solve them, i.e. {$ifdef 
windows}/{$ifdef unix}.

> 3. The book does not cover objects in depth. I'm of two minds about how to 
> cover object-oriented programming: I prefer Delphi's object model, but I've 
> used Turbo Vision (I named it, in fact) and have some example code. Which 
> would be better? (I don't think I would cover objects in the first book, at 
> any rate.

This is a though decision, for which there is no simple answer. Certainly, 
Lazarus is a lot more popular than Turbo Vision, so it makes more sense to 
explain classes. On the other hand, you can write so much about Lazarus 
that it would be a book on its own. Explaining people how to write OOP 
code, while at the same time showing them how to write some Turbo Vision 
programs might make sense too.

> 4. How important is it to cover GUI apps written from text mode? (That is, 
> without using Lazarus or something else Delphi-like.) This wouldn't be in the 
> first volume, obviously, but are enough people doing it (whether for Windows 
> or Linux) to make the coverage worthwhile? I didn't do much on GUI apps prior 
> to Delphi, apart from some minor messing around with Turbo Pascal for 
> Windows. So that would be all new research for me and might take awhile--and 
> I would prefer to cover it via Lazarus anyway.

There aren't many people writing bare Windows API applications, most use 
Lazarus. So, there isn't much need to cover this.

However, you want to cover something modern, i.e. the crt unit is rather 
dated, and people want to learn how to code some "real" applications. A 
chapter about GUI is one way to solve it; but you could for example also 
cover JEDI-SDL and teach them how to write a simple game.

> That's the most of it. Alas, I don't have a Mac and can't really cover OS/X. 
> However, if anyone here would like to work over the material once I release 
> it for FPC, I'd be happy with that.

Consider Mac and Linux one and the same. As long as people learn to use 
the {$ifdef unix} correctly, code will generally work on both Mac, Linux 
and FreeBSD. Of course people don't learn how to code Aqua applications 
this way, but you can ignore that; people can successfully work though the 
book and learn Pascal, even if they use a Mac.

> Do let me know what you think. I need to mention that I work fairly slowly 
> (mostly because I'm not retired and have a lot of other things to do) but I'm 
> willing to release chapters as I finish them if people want them.
> Good luck and thanks for listening. I'm on the list now and will start 
> digging back into FPC again.

Many thanks!!


More information about the fpc-devel mailing list