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
Text File  |  1992-04-13  |  8KB  |  163 lines

  1. By: Darrell Cadwallader
  2. Re: Borland vs. StonyBrook Pascal
  3.  
  4.  
  5.                    Stony Brook Pascal+ vs. TP60
  6.  
  7. Some time there were some questions about the new Stony Brook PASCAL+ on
  8. this list. Now I found an 8 page article (test) about it in the November
  9. 1991 issue of the German monthly computer magazine c't. It is too long
  10. to translate it all, so here are some of the important facts:
  11.  
  12. (for those how have access to German print media and can read German:
  13. c't - magazin  fuer computer-technik, 11 (november) 1991, page
  14. 146-154)
  15.  
  16. (And: I have no connections to the c't nor to Stony Brook nor to
  17. Borland ..)
  18.  
  19. (All opinions following are from the article in c't, so don't blame me..)
  20.  
  21. (SBP+ = Stony Brook PASCAL+, TP60 = TurboPascal v 6.0, TPW =
  22. TurboPascal for Windows, MS = MicroSoft)
  23.  
  24. price of Stony Brook Pascal+ : 375 US$ directly from Stony Brook,
  25. California
  26.  
  27. SBP+ is source code compatible to TP60, but it is also possible to write
  28. Windows applications using the "good old" units CRT, DOS and GRAPH.
  29. These applications are not event-driven, but run in the protected mode,
  30. that is you can use more memory.
  31.  
  32. TP60 is a sort of an island (TPU, no OBJ files and LIBs from other
  33. languages and compilers, no code for debuggers other than Borland).
  34. There is the danger of writing non-portable code that can't be used any
  35. more in the future.
  36.  
  37. This can be by-passed by SBP+:
  38. - migration to Windows,
  39. - more possibilities in passing parameters and variables to subroutines:
  40.   variable number of parameters, variable order,
  41.   long or short addresses for references, windows pro/epilogue,
  42.   flexible symbol names for the linker etc.
  43.   So virtually any API or library can be accessed (more flexible
  44.   even than C)
  45. - it is possible to link programs using other runtime
  46.   systems and libs like Borland C++, MS-C etc.
  47. - SBP+ can generate C-Programs (OBJ) including PASCAL libs
  48. - SBP+ can generate a C main function instead of a Pascal Program
  49.   to integrate it in a C runtime system
  50. - mixed applications in C and Pascal can be written, both using
  51.   the C or the Pascal runtime system (heap management and co-processor
  52.   included)
  53. - SBP+ works together with any Linker, LIBrarian, bibs, debugger etc.
  54.   that use MS OBJ and/or LIB format (including MS-CodeView)
  55.    (so it should be possible to use FORTRAN subroutines!! CB)
  56. - there are many code optimizing possibilities (bad in TP60)
  57. - there is no IDE like TP60, just a SBE shell that calls the
  58.   command line programs, so compiling and linking is real slow
  59.   (up to 10 times slower than in TP60)
  60. - big projects can be handled easily: up to 8 module bibs, each
  61.   containing bibs, OBJ, source code are possible (eg.: a toolbox like
  62.   Object Professional can be treated as one module bib
  63. - changes and interdependences are recognizes and treated right, but
  64. - there is a "normal" MAKE (SBMAKE), the make files are generated from
  65.   the PASCAL source
  66. - the SBE looks like the old TP5.5, but the editor is not so good
  67.   (WordStar like)
  68. - no PASCAL specific online help
  69. - the compiler generates OBJ files (MS), a librarian (SBLINK) can generate
  70.   LIBs as well, and it is a "smart linker", linking only those parts of
  71.   a LIB that are needed
  72. - if you don't like SBLINK, you can use any (newer) MS compatible
  73.   linker instead, eg. MS-LINK or Borlands TLINK
  74. - to link Windows application, you need MS-LINK (from any MS-compiler or
  75.   MASM)
  76. - no UNIT OVERLAY!!! overlays are possible, but only static. You
  77.   have to decide yourself about the overlay parts and tell it the linker
  78.   (MAP files!!)
  79. - no EMS for overlay, but you can put different procedure from ONE unit
  80.   in DIFFERENT overlay parts
  81. - SBP+ and SBLINK run as well in protected mode if needed
  82. - SBLIB can be replaced by another MS LIB program
  83. - the Stony Brook debugger is better than the _ integrated_ debugger
  84.   of TP60: (eg.: can display the generated machine code), but is not as
  85.   good as the external Borland debugger but : SBP+ generates MS-CodeView
  86.   compatible symbol information, so you can use other debuggers instead
  87. - compatibility: the compiler is 100% source code compatible
  88.   (even TurboVision source code can be compiled), but there is
  89.   no unit OVERLAY (see above) and there are some minor changes
  90.   in the CRT unit
  91. - instead of BGI graphics there is the Shareware program TEGL included,
  92.   working with TGIs, so GRAPH is nearly the same,but there is only one
  93.   font included and no CHR file that you have to get from somewhere
  94.   else (should be no problem via FTP, but without...)
  95. - no TurboVision (those who have the TV source code, can compile it):
  96.   instead Shareware program "TechnoJock Object-Toolkit" with comparable
  97.   capabilities as TV, and the GUI supplied with TEGL is good. But both
  98.   are shareware and if you want to write commercial programs (sell it),
  99.   than you will have to register: TEGL: 100 US$, TechnoJock: 70 US$.
  100.   Both are included in source code. - Windows applications: with CRT and
  101.   GRAPH in Windows version, it is possible to use programs under Windows,
  102.   but that aren't real Windows programs!! For this the about 500 API
  103.   functions are needed. All these are included (in source code) as
  104.   an UNIT WINDOW, but without documentation, so you need the MS SDK
  105.   reference and/or a good book. No other windows tools are included
  106.   (resource-compiler, -editor, -linker, -debugger, -help-compiler), so
  107.   you will need the MS SDK itself in addition. So Windows programming IS
  108.   possible (in contrast to TP60), but it is quite difficult (but with
  109.   TPW you can ONLY write Windows applications!).
  110.  
  111. - the best thing with SBP+ is the optimizer:
  112.   TP60 is a fast compiler, SBP+ is a compiler that generates fast code!
  113.   the optimizer - eliminates dead code
  114.                 - recognizes constant expressions in loops and pulls
  115.                   them out of the loop etc.
  116.                 - profiler (ANALYSE) included (checks the time consumed by
  117.                   different parts of the program eg.)
  118. - some benchmarks (a c't standard benchmark is used
  119.   (modified so that NO constant expressions appear inside of the loops)):
  120.  
  121.    item           TP60(TPCX)      SBP+          SBP+ with optimization
  122.  
  123.    HL-benchmark
  124.    compiling(sec)    0.5          9.1           9.5
  125.    code size(Bytes)  26352        28536         28256
  126.  
  127.    Intmath(sec)      8.51         2.58          0.17
  128.    Realmath(sec)     1.92         1.32          0.22
  129.    TrigLog  (sec)    2.03         2.25          0.16
  130.    Textscreen(sec)   5.11         3.95          3.95
  131.    GraphScreen(sec)  0.99         0.82          0.82
  132.    Store(sec)        0.22         0.16          0.16
  133.  
  134.    Sieve(sec)        7.69         7.31          2.80
  135.    Fibonacci(sec)   30.01        20.03         17.50
  136.    Intmath2(sec)    10.47        12.13          4.20
  137.    Realmath2(sec)    9.56        12.86          1.96
  138.    TrigLog2(sec)    29.32        36.12         35.90
  139.  
  140.  
  141.  - SBP+ compiler options:
  142.  - optimization strategies: speed or size,
  143.                             common subexpressions
  144.                             loop invariant motion
  145.                             induction variables elimination
  146.                             constant/copy propagation
  147.                             dead code elimination
  148.                             dead store elimination
  149.                             jump chaining
  150.                             live variable analysis
  151.                             peephole optimizations
  152.                             register parameter passing
  153.                             loop rewriting
  154.                             cross module reg parameters
  155.                             conditional common subexpressions
  156.  
  157.  - code generating options: initialize data
  158.                             aliasing occurs
  159.                             emulate floating point
  160.                             numeric coprocessor
  161.                             overlay
  162.                             generate sparse cases  (IFs instead of CAS
  163.