Berend de Boer wrote:
The point of having an extended pascal compiler is being portable, at least that's the goal.
I agree to the goal of being portable. But I don't think that we can reach this goal just by obeying the Extended Pascal standard.
(More about this in a separate mail.)
Assembler and Dos are not the way to go. The point of having a System, Crt, Printer of Graph unit is entirely uninteresting if it is not portable except if you want to port Dos Borland Pascal programs to Extended Pascal.
I want to port DOS Borland programs to *GNU Pascal*, and I am sure that many people intend the same. System, Crt, Printer and Graph for GNU Pascal would be *highly interesting* for those programmers who are accustomed to Borland Pascal and think about changing to GNU Pascal (instead of changing to Delphi or C++) in the future. To have those Units on the DOS platform only would be a starting point -- portable versions would be preferred, of course.
Why should anyone want to do this? I assume everyone is programming for Windows 95/Windows NT or Unix. Are programmers really running Dos today??
Yes, I am for example. More concrete, I am working in an OS/2 DOS box and in the Linux DOSemu (with Novell DOS 7). I do not intend to use Windows 95 or Windows NT, and it will take a long time to get my clients using UNIX (Linux). Up to that day, I will prefer writing good DOS programs to writing poor Windows programs (with a lot of special effects, but slow, uncomfortable, and unstable). In the long term, I intend to become completely platform independent with my BO5 library, i.e. my programs will run under Windows 95/NT, too, just be recompiling. But for the moment, I am stuck with DOS.
Quite a few calls in System or Crt do simply not apply in non-Dos environments.
There are really few of them, but since the source exists, I suggest that somebody ports *everything* to the DOS version of GPC, and we can make the "potentially portable" parts portable in a second stage.
A portable Printer library??
What's the problem? It would just be a Unit (Module) which "knows" the file name of the printer device for the actual operating system and opens a text file "lst", so the application program doesn't need to care about how the printer is named on the operating system.
The calls from System that are portable can for 90% be written in plain Extended Pascal.
However, it would be nice to have a compatibility Unit (Module) which simplifies the port of Borland Pascal programs to GNU Pascal.
We should do better by following existing standards and provide EP interfaces for that.
Borland's Units *are* an existing standard. There may be other standards, but I think these Units are very popular. Furthermore, we *have* the source for them, so I ask again:
******************************************************* We have free sources of Borland Units (CRT, Graph, ...) which cry for being ported to GNU Pascal.
Anybody wants to do the job? *******************************************************
Greetings,
Peter
Hmm ... I'm started to get interested now. I *may* be interested in doing stuff for Linux (may is the operative word here 'tho, folks ... since being a student tends to eat up a lot of my time ...). Has the "Borland UNITs" problem been fixed with GPC yet? Or are we still stick with that rather nasty (IMHO of course) hack we had to do by #including the the UNIT file in any program we wished to use that unit?
On Tue, 23 Jul 1996, Peter Gerwinski wrote:
would be *highly interesting* for those programmers who are accustomed to Borland Pascal and think about changing to GNU Pascal (instead of changing to Delphi or C++) in the future. To have those Units on the DOS platform only would be a starting point -- portable versions would be preferred, of course.
The last time I checked out your BO5 library, Peter, any program that used your Crt unit, I think, had to be set uid on the Linux platform 'cause it did direct screen writes. Is this still true? Or did you change it to use NCurses yet?
Personally I recommonend making it SLang-based rather than NCurses-based. Mainly because the SLang screen management routines are faster than NCurses. Also, SLang is also a highly portable library in in itself (with versions for DOS, OS/2, and other unices in addition to Linux). I don't recall ever seeing a DOS NCurses (Curses perhaps, but not NCurses).
I've already written a Crt-like MODULE for Gardens Point Modula-2 compiler which are SLang-based. Shouldn't be too hard to convert over to GPC. That is ... if anybody is interested ...
A portable Printer library??
What's the problem? It would just be a Unit (Module) which "knows" the file name of the printer device for the actual operating system and opens a text file "lst", so the application program doesn't need to care about how the printer is named on the operating system.
Yeah .. it shouldn't be too hard to implement Printer ... it seems rather straight forward to me.
Borland's Units *are* an existing standard. There may be other standards, but I think these Units are very popular. Furthermore, we *have* the source for them, so I ask again:
However, like the other guy said, certain things in Borland Pascal only make sense under DOS (like the Mem[] variable and ABSOLUTE variables). Of course we could just do what other Borland-Pascal like compilers for other platforms (like Virtual Pascal and Speed Pascal/2 for OS/2) do, and just ignore them.
=============================================================================== Arcadio Alivio Sincero, Jr. Sophomore, Computer Science Major at the University of Maryland at College Park Amateur competitive bodybuilder Email: lotu@wam.umd.edu, WWW: <coming soon to a web site near you!>
"D.A.R.E. .... to keep cops off donuts."
Arcadio wrote:
Has the "Borland UNITs" problem been fixed with GPC yet? Or are we still stick with that rather nasty (IMHO of course) hack we had to do by #including the the UNIT file in any program we wished to use that unit?
I am just working on that problem and I'm pretty sure that it will be fixed in the next release. But please be patient since it is *hard* work and...
since being a student tends to eat up a lot of my time ... :-)
The last time I checked out your BO5 library, Peter, any program that used your Crt unit, I think, had to be set uid on the Linux platform 'cause it did direct screen writes. Is this still true? Or did you change it to use NCurses yet?
Use -D TERMCAP instead of -D LINUX and link the -ltermcap library. export CL_COLOR=YES in order to get ANSI colors.
Since I want to have BO5 being portable to *all* platforms including OS/2pm and Windoze, I want to avoid to rely on special libraries. I will probably use (S)VGALIB with Linux which is part of the operating system, but I will even try to avoid linking the termcap library in the next release since I have found computers where it is not installed (!).
Since I am rewriting kind of Turbo Vision (but with graphics mode, too) I actually won't need something like ncurses. When my progress on BO5 is so slow, this has (almost) no technical reasons but it's a question of time. Currently, I am hacking around in the interior of GPC, in programs I want to sell, and in my dissertation thesis in physics.
I've already written a Crt-like MODULE for Gardens Point Modula-2 compiler which are SLang-based. Shouldn't be too hard to convert over to GPC. That is ... if anybody is interested ...
Since my BO5 will take some time to become really useful, I think that everything which replaces CRT etc. is highly welcome by the GPC users, even if it is not portable to all platforms.
But once more: I have free sources of CRT, Graph, etc. ... I don't want to port them myself because I think it is more important that I work on the compiler itself and on BO5.
Yeah .. it shouldn't be too hard to implement Printer ... it seems rather straight forward to me.
Here is the DOS version:
Unit Printer;
Interface
uses Tools; (* we need Assign *)
Var lst: Text;
Implementation
to begin do (* Extended Pascal initializers and finalizers *) begin Assign ( lst, 'prn' ); rewrite ( lst ); end (* to begin *)
to end do close ( lst );
end.
I didn't test it, but it should work. (-: Now it's your turn to make it portable. ;-)
However, like the other guy said, certain things in Borland Pascal only make sense under DOS (like the Mem[] variable and ABSOLUTE variables).
Absolute variables *make* sense not only under DOS when you use them instead of variant records to convert data. Look into the Tools Unit from BO5 for examples. (Yes, GPC has "absolute".)
Yours,
Peter
-------------------------------------------------------------------------------- Dipl. Phys. Peter Gerwinski Fachbereich Physik Universitaet-GH Essen Phone: +49-201-183-2763 D-45117 Essen Fax: +49-201-183-2120 Germany e-mail: peter.gerwinski@uni-essen.de --------------------------------------------------------------------------------