home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
TP&SBP
/
TP&SBP.TXT
Wrap
Text File
|
1992-04-13
|
8KB
|
163 lines
By: Darrell Cadwallader
Re: Borland vs. StonyBrook Pascal
Stony Brook Pascal+ vs. TP60
Some time there were some questions about the new Stony Brook PASCAL+ on
this list. Now I found an 8 page article (test) about it in the November
1991 issue of the German monthly computer magazine c't. It is too long
to translate it all, so here are some of the important facts:
(for those how have access to German print media and can read German:
c't - magazin fuer computer-technik, 11 (november) 1991, page
146-154)
(And: I have no connections to the c't nor to Stony Brook nor to
Borland ..)
(All opinions following are from the article in c't, so don't blame me..)
(SBP+ = Stony Brook PASCAL+, TP60 = TurboPascal v 6.0, TPW =
TurboPascal for Windows, MS = MicroSoft)
price of Stony Brook Pascal+ : 375 US$ directly from Stony Brook,
California
SBP+ is source code compatible to TP60, but it is also possible to write
Windows applications using the "good old" units CRT, DOS and GRAPH.
These applications are not event-driven, but run in the protected mode,
that is you can use more memory.
TP60 is a sort of an island (TPU, no OBJ files and LIBs from other
languages and compilers, no code for debuggers other than Borland).
There is the danger of writing non-portable code that can't be used any
more in the future.
This can be by-passed by SBP+:
- migration to Windows,
- more possibilities in passing parameters and variables to subroutines:
variable number of parameters, variable order,
long or short addresses for references, windows pro/epilogue,
flexible symbol names for the linker etc.
So virtually any API or library can be accessed (more flexible
even than C)
- it is possible to link programs using other runtime
systems and libs like Borland C++, MS-C etc.
- SBP+ can generate C-Programs (OBJ) including PASCAL libs
- SBP+ can generate a C main function instead of a Pascal Program
to integrate it in a C runtime system
- mixed applications in C and Pascal can be written, both using
the C or the Pascal runtime system (heap management and co-processor
included)
- SBP+ works together with any Linker, LIBrarian, bibs, debugger etc.
that use MS OBJ and/or LIB format (including MS-CodeView)
(so it should be possible to use FORTRAN subroutines!! CB)
- there are many code optimizing possibilities (bad in TP60)
- there is no IDE like TP60, just a SBE shell that calls the
command line programs, so compiling and linking is real slow
(up to 10 times slower than in TP60)
- big projects can be handled easily: up to 8 module bibs, each
containing bibs, OBJ, source code are possible (eg.: a toolbox like
Object Professional can be treated as one module bib
- changes and interdependences are recognizes and treated right, but
- there is a "normal" MAKE (SBMAKE), the make files are generated from
the PASCAL source
- the SBE looks like the old TP5.5, but the editor is not so good
(WordStar like)
- no PASCAL specific online help
- the compiler generates OBJ files (MS), a librarian (SBLINK) can generate
LIBs as well, and it is a "smart linker", linking only those parts of
a LIB that are needed
- if you don't like SBLINK, you can use any (newer) MS compatible
linker instead, eg. MS-LINK or Borlands TLINK
- to link Windows application, you need MS-LINK (from any MS-compiler or
MASM)
- no UNIT OVERLAY!!! overlays are possible, but only static. You
have to decide yourself about the overlay parts and tell it the linker
(MAP files!!)
- no EMS for overlay, but you can put different procedure from ONE unit
in DIFFERENT overlay parts
- SBP+ and SBLINK run as well in protected mode if needed
- SBLIB can be replaced by another MS LIB program
- the Stony Brook debugger is better than the _ integrated_ debugger
of TP60: (eg.: can display the generated machine code), but is not as
good as the external Borland debugger but : SBP+ generates MS-CodeView
compatible symbol information, so you can use other debuggers instead
- compatibility: the compiler is 100% source code compatible
(even TurboVision source code can be compiled), but there is
no unit OVERLAY (see above) and there are some minor changes
in the CRT unit
- instead of BGI graphics there is the Shareware program TEGL included,
working with TGIs, so GRAPH is nearly the same,but there is only one
font included and no CHR file that you have to get from somewhere
else (should be no problem via FTP, but without...)
- no TurboVision (those who have the TV source code, can compile it):
instead Shareware program "TechnoJock Object-Toolkit" with comparable
capabilities as TV, and the GUI supplied with TEGL is good. But both
are shareware and if you want to write commercial programs (sell it),
than you will have to register: TEGL: 100 US$, TechnoJock: 70 US$.
Both are included in source code. - Windows applications: with CRT and
GRAPH in Windows version, it is possible to use programs under Windows,
but that aren't real Windows programs!! For this the about 500 API
functions are needed. All these are included (in source code) as
an UNIT WINDOW, but without documentation, so you need the MS SDK
reference and/or a good book. No other windows tools are included
(resource-compiler, -editor, -linker, -debugger, -help-compiler), so
you will need the MS SDK itself in addition. So Windows programming IS
possible (in contrast to TP60), but it is quite difficult (but with
TPW you can ONLY write Windows applications!).
- the best thing with SBP+ is the optimizer:
TP60 is a fast compiler, SBP+ is a compiler that generates fast code!
the optimizer - eliminates dead code
- recognizes constant expressions in loops and pulls
them out of the loop etc.
- profiler (ANALYSE) included (checks the time consumed by
different parts of the program eg.)
- some benchmarks (a c't standard benchmark is used
(modified so that NO constant expressions appear inside of the loops)):
item TP60(TPCX) SBP+ SBP+ with optimization
HL-benchmark
compiling(sec) 0.5 9.1 9.5
code size(Bytes) 26352 28536 28256
Intmath(sec) 8.51 2.58 0.17
Realmath(sec) 1.92 1.32 0.22
TrigLog (sec) 2.03 2.25 0.16
Textscreen(sec) 5.11 3.95 3.95
GraphScreen(sec) 0.99 0.82 0.82
Store(sec) 0.22 0.16 0.16
Sieve(sec) 7.69 7.31 2.80
Fibonacci(sec) 30.01 20.03 17.50
Intmath2(sec) 10.47 12.13 4.20
Realmath2(sec) 9.56 12.86 1.96
TrigLog2(sec) 29.32 36.12 35.90
- SBP+ compiler options:
- optimization strategies: speed or size,
common subexpressions
loop invariant motion
induction variables elimination
constant/copy propagation
dead code elimination
dead store elimination
jump chaining
live variable analysis
peephole optimizations
register parameter passing
loop rewriting
cross module reg parameters
conditional common subexpressions
- code generating options: initialize data
aliasing occurs
emulate floating point
numeric coprocessor
overlay
generate sparse cases (IFs instead of CAS