Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-01

On recasting BORLAND PASCAL FROM SQUARE ONE for Free Pascal

14 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

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.

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?

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.

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.

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.

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.

--73--

--Jeff Duntemann
Colorado Springs, Colorado
www.duntemann.com

Reply by email

Daniël Mantione
to Jeff Duntemann

Op Sun, 6 Jan 2008, schreef Jeff Duntemann:

Show quoted text 7 lines
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.

Show quoted text 18 lines
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.

Show quoted text 20 lines
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 books.

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

Show quoted text 5 lines
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.

Show quoted text 7 lines
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.

Show quoted text 6 lines
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!!

Daniël

Reply by email

Joost van der Sluis
to Jeff Duntemann: Hi everybody-- I figured I would introduce myself, having just signed on to the list…

Op zondag 06-01-2008 om 16:26 uur [tijdzone -0700], schreef Jeff Duntemann:

I figured I would introduce myself, having just signed on to the list here. Some of you may already know me and my work.

Well, I'm happy to say welcome to you here. After all, you're the one who learned Pascal to me...

If you need any help, or have any questions regarding FPC, I'll be happy to help. And I'm sure others are also...

Show quoted text 6 lines
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.

That won't be a problem, when the books are available as ebook. And those people who really want a printed copy, they won't mind ordering two or three books.

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?

The original book was based on console and bgi-programs only. As long as it stays that way, it doesn't matter much. Using and calling FPC doesn't differ much on both OS'es. You have to know how to open a console in windows and linux. That's about it. And there are some differences regarding file path's, file-rights etc, but that doesn't matter much. The code should be portable.
What does differ is the installation on both OS'es. But you could write about that in two paragrahs. Or something similar?

Overall I think that most ppl who are using FPC are using windows. But those who are writing console-based applications mostly use linux. And there are more mainly linux-based developers. (And then I mean developers of FPC/Lazarus itself)

Show quoted text 5 lines
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.

The TP-Object model is supported fully. But I think that hardly anyone uses it anymore. (Although there was someone on the fpc-devel list last week) So base it on the Delphi object model. Or, on classes, as we call it.

Show quoted text 8 lines
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.

I won't call it one of the most important things. It is done, using OpenGL or SDL by some game-developers.

Show quoted text 8 lines
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. 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.

That's no problem. We are all volunteers.

Good luck and thanks for listening. I'm on the list now and will start digging back into FPC again.

Nice to have you here.

Joost.

Reply by email

Michael Schnell
to Jeff Duntemann: Hi everybody-- I figured I would introduce myself, having just signed on to the list…

While this of course is a good idea (and decent comments were presented by others), ...

Why not (based on the text you have) write a real (commercial) book on Lazarus.

Lazarus is approaching a non-beta state and is available for many platforms.

Some days ago I used Lazarus to cross-compile a (testing-) application that I loaded on a GloFish cell-phone. The only effort was to unzip the additional (ARM-) compiler and (WinCE-) libraries from a single Zip file, select the appropriate Target-CPU and Target OS in a GUI menu and press F9. Now I could upload the resulting exe file to the GloFish and it showed the Form; and pressing the buttons worked like intended.

I think that's really impressing and to me using Delphi with .NET (if possible at all) does not seem more attractive.

Moreover you can install Lazarus on Windows, Linux or Mac and use the same source code to create your applications for the appropriate platform. (Of course you can create GUI programs, command-line-tools, dlls, and even CGI-applications to be used with Apache.)

The usability of Lazarus for the development of many (or most of that class of ) hobby- and commercial products is slowly reaching the level of Delphi's, (as with most community projects) the documentation is always a problem.

This is why IMHO a decent book on Lazarus is really due and should find a decent count of customers.

I'm sure here and in the Lazarus forums, you will find any support you might request.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 5 lines
While this of course is a good idea (and decent comments were presented by others), ... Why not (based on the text you have) write a real (commercial) book on Lazarus.

Well, a (german) lazarus book is in the works, by C&L. Work has actually started.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Well, a (german) lazarus book is in the works, by C&L. Work has actually started.

Sounds good.

Of course there is room for more than one book if the authors care to target different aspects. (Delphi language, GUI/LCL, beginners, "in depth" reference, multi-platform, networking, ... )

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 9 lines
> Well, a (german) lazarus book is in the works, by C&L. Work has actually > started. > Sounds good. Of course there is room for more than one book if the authors care to target different aspects. (Delphi language, GUI/LCL, beginners, "in depth" reference, multi-platform, networking, ... )

Absolutely. For example:
At the same time the Free Pascal book will be updated and re-released.

Michael.

Reply by email

Florian Klaempfl
to Michael Schnell: Sounds good. Of course there is room for more than one book if the authors care to target…
Show quoted text 9 lines
> Well, a (german) lazarus book is in the works, by C&L. Work has > actually started. > Sounds good. Of course there is room for more than one book if the authors care to target different aspects. (Delphi language, GUI/LCL, beginners, "in depth" reference, multi-platform, networking, ... )

I guess the cul books won't be that language/programming tutorial like so they don't interfere with Jeff's book.

Reply by email

Marco van de Voort
to Florian Klaempfl
Show quoted text 13 lines
Michael Schnell schrieb: > >> Well, a (german) lazarus book is in the works, by C&L. Work has >> actually started. >> > Sounds good. > > Of course there is room for more than one book if the authors care to > target different aspects. (Delphi language, GUI/LCL, beginners, "in > depth" reference, multi-platform, networking, ... ) I guess the cul books won't be that language/programming tutorial like so they don't interfere with Jeff's book.

Sure. I would keep much of the original content in place,mostly kill dos specific topics though (but some, like port IO could be kept updated with ioperm and io.dll)

The object dialect is a bit of a problem. Sources for the classic model are running out, and it would nice to have something that describes it in a tutorial way indepth. Maybe some Delphi text will come across our path later.

The OS is also a bit of a problem. Linux is more heavier oriented towards console use, but has the hassle of terminal dependance. (though Daniel improved this greatly an year back).

Reply by email

Felipe Monteiro de Carvalho
to Michael Van Canneyt: Well, a (german) lazarus book is in the works, by C&L. Work has actually started. Michael.
Michael Van Canneyt wrote
Well, a (german) lazarus book is in the works, by C&L. Work has actually started.

That's really excelent! Any plans on having an english translation?

Althougth I can read german, I would be interrested in buying some copies for people I work with in Brazil, which can't read german.

There is already a portuguese basic level free pascal book ( http://www.editoraerica.com.br/buscafinal.asp?cod=1369 ), but nothing on the Lazarus area.

Going back on the topic a little bit, I know at least a portuguese and an hungarian basic level free pascal books. An english free pascal book would be an excelent addition and make a lot of success worldwide.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Joost van der Sluis
to Daniël Mantione: Op Sun, 6 Jan 2008, schreef Jeff Duntemann: I read the Dutch translation "Turbo Pascal…

Op maandag 07-01-2008 om 01:06 uur [tijdzone +0100], schreef Daniël Mantione:

Show quoted text 12 lines
> 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.

I've been thinking about this last night. I can't remember the book exactly and I don't have a copy of my own yet, (I ordered one).

But what you could do is go on with the current book. And add a section about classes to it (in the second part, for example, instead of a section about objects). Thereafter you could add a chapter about the LCL. And then not in the way that you create a lazarus-application with 'drag&drop'. But create an application with one form from scratch. In code. Just like you would do with Turbo Vision. And as I can remember from my Turbo-vision books. (Turbo Vision in de praktijk)

Then you could address in a new chapter the streaming capabilities. And then stream the form you've created earlier to disk, and load it again. Thereafter you could do one chapter to introduce programming with Lazarus in the Drag&Drop way. That way you introduced to people how things really work...

I understand that this won't be ready tomorrow. But it can be done step-by-step.

Do you like the idea in general? (Is it clear what I mean?)

Further I'm wondering what IDE you want to write about. You could use the textmode fp-ide, offcourse. That's the closest to the old Turbo Pascal IDE. But you could also use Lazarus as a ide. And then not the graphical stuff, but as a IDE to create console-applications.

Joost.

Reply by email

Jeff Duntemann
to Michael Schnell: While this of course is a good idea (and decent comments were presented by others), ...…

Interesting idea--and I have an intro book to Delphi 2 that could be adapted. I would have to publish it myself, as the American computer book publishing business is in bad shape right now, but I know how to do that, at least.

--73--

--JD--

Michael Schnell wrote 41 lines
While this of course is a good idea (and decent comments were presented by others), ... Why not (based on the text you have) write a real (commercial) book on Lazarus. Lazarus is approaching a non-beta state and is available for many platforms. Some days ago I used Lazarus to cross-compile a (testing-) application that I loaded on a GloFish cell-phone. The only effort was to unzip the additional (ARM-) compiler and (WinCE-) libraries from a single Zip file, select the appropriate Target-CPU and Target OS in a GUI menu and press F9. Now I could upload the resulting exe file to the GloFish and it showed the Form; and pressing the buttons worked like intended. I think that's really impressing and to me using Delphi with .NET (if possible at all) does not seem more attractive. Moreover you can install Lazarus on Windows, Linux or Mac and use the same source code to create your applications for the appropriate platform. (Of course you can create GUI programs, command-line-tools, dlls, and even CGI-applications to be used with Apache.) The usability of Lazarus for the development of many (or most of that class of ) hobby- and commercial products is slowly reaching the level of Delphi's, (as with most community projects) the documentation is always a problem. This is why IMHO a decent book on Lazarus is really due and should find a decent count of customers. I'm sure here and in the Lazarus forums, you will find any support you might request. -Michael _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email