80-Bus News

  

May–June 1983, Volume 2, Issue 3

Page 54 of 59

Doctor Dark’s Diary – Episode 16.

Two “Pascal” compilers slug it out! Is it Wirth reading this?

Regular readers will know that I like Pascal, and that I tend to go on at length about the virtues I think I see in the compiler I usually use. I must have hinted really well that I would like free things to review a while ago because the postman brought me a nice shiny new compiler to Play with, and I am sure I didn’t ray for it! This was a very nice surprise, as you can imagines and I rapidly set about attempting to use it. It seems like a good idea to compare and contrast the two Pascal systems I now have, so that, if you are thinking about changing from BASIC, you can get some sort of idea which of the two would be better for your purposes. Obviously, I am unable to comment on other systems I have not yet seen, and this does not imply any criticism of these others… Serves them right for not sending me freebies though!

The one I already owned is the Hisoft Pascal 4 compiler sold for £40. The new one is the Poly-Data Compas system, which costs £120, plus VAT. To save a little space, I intend to refer to them as either Hisoft or Compas throughout. If you buy the Hisoft, you get a floppy disc and about fifty five pages of manual, loose pages, that is. Compas also comes on a floppy disc, but has a very smart blue folder which contains, at a guess, a hundred pages. Both of them run under CP/M, so don’t get either if you are running an unexpanded Nascom 1.

Hands up all these who wondered why I put quotation marks round the word “Pascal” in the heading. Why? Well neither of these compilers is a full implementation of standard Pascal, and both of them have extras that are not standard. I don’t think there is a full micro Pascal about vet, but am willing to accept one free if I’m wrong! What you get are subsets of the language, with additions that the compiler writer thinks you will want. Hisoft only allows FILEs of CHARe like CE/M’s ASCII files. It does net cater for VARIANTS in RECORD types. Compas doesn’t have SET, POINTER, or CHAR types. Neither of them will let you pass a Procedure or a function as a parameter to an other procedure or function, but I have never particularly wanted to do this latter thing! In fact, I have never met anyone who could tell me in nice short words why anyone would want to complicate a nice simple language by doing such a bizarre thing. I dare say it is all the rage in university computing departments… The SET types are something quite useful, which is not the impression given in many books about Pascal, where examples often feature lists of cheeses. POINTERs are very useful, and their absence from Compas indicates that dynamic data structures are also missing. So if you want to use linked lists, and build them up dynamically, you have to go about it in a less easy way than would be the case with Hisoft. I will describe the various extras facilities the two compilers provide later on in the article.

Hisoft only provide a compiler, which requires ASCII text files as its input, and it is up to you what you use to edit them. Any reasonable word processor will de the Job, and only a masochist would try to use ED.COM for the job, so there is a hidden cost. Compas is a more complex system, designed to make program development faster. It has a built in editors and can stay in memory along with the source program and the compiled result [assuming there is room]. So you can edit your program, compile it, and then run it, all without returning to CP/M. Learning to use a new editor is always a problem, and at first it always seems as though the designer has gone out of his way to choose really unlikely keys to give the editor its commands. The Compas editor still seems very strange to me, as it has two modes of operations and I always seem to have it in the wrong one. The other problem is that the list of editor commands in the manual is separate from the list of which keys you have to press. This is presumably to make it easier for Poly-Data to change the manual to suit machines with different keyboards. I think it would have been a more friendly idea to put the two sections together, and write a separate manual for each machine the program is to be used on. To be fairy this would not he a problem once one became used to using the editor, but at first it is infuriating.

Page 54 of 59