Your Spectrum
Issue 8, October 1984 - Paperdata: The Language Barrier
Home Contents KwikPik
The catalogue of programming languages you can run on your Spectrum is growing steadily - already it includes Pascal, Logo, Prolog, and countless versions of Basic and Forth. Mr Zip himself, Simon Goodwin, looks at an overall guide to computer languages and two texts on Pascal.




In the dark days before YS was born, author Garry Marshall spent some of his formative years writing for Computing Today (Who didn't? Ed.). His magazine series set out to explain a programming language each month - now Newnes Programming Books has given him the chance to develop that theme.


Programming Languages For Micros is a paperback of 126 pages. It covers more or less every language which is fashionable among micro enthusiasts, although two of the most influential - 'C' and Logo - are only mentioned in passing. It starts with an excellent introduction to high-level languages. Dr Marshall neatly explains the purpose of computer languages and the costs and benefits of different approaches to the task of converting human problems into ones which a computer can solve.
The next chapter contains detailed examples of Basic and Pascal. Once again the approach is readable, although the author's academic background begins to show through.
Languages like Comal, Lisp, APL, Forth and Prolog are handled next, along with the venerable 'ancients', Fortran and Cobol. The sections on APL and Forth are perhaps the least satisfactory. The coverage of APL only mentions expressions, and gives the impression that the author is unaware of the way APL functions can be defined and grouped together in 'workspaces'. The coverage of Forth makes no mention of the useful 'compiling words' which allow programmers to re-design their system.
Graphics are handled next, with an explanation of GINO - not strictly a language at all, but a set of Fortran subroutines which allow the user to generate intricate graphics in two or three dimensions. The explanation of WSFN - a robot-control language - is fascinating, although it was irritating not to be told what the name stands for! Finally the book looks at Pilot, a simple language that's used to design 'question and answer' educational programs.
Programming Languages For Micros is a good book for anyone interested in
programming for its own sake, as opposed to programming to solve specific problems. The text is quite well- written and - most important of all in a book for hobbyists - the overall tone is enthusiastic.


Our next book is also from Newnes, and is written by another Computing Today contributor, Mike James. I pipped him to the post with the CT series on Pascal, so he has retaliated with a book to join the 20 or so 'introductions to Pascal' which are already in print.
Pascal For Micros is a well-presented 170-page paperback. The publication has two main sections. The first part explains enough statements to allow simple programs to be written ... and in the second, there's a discussion of more sophisticated features such as procedures, functions, and non-trivial datatypes. Each section is followed by a chapter of example programs. Towards the end of the book there is a discussion of

"Wouldn't it be fun if we could write a Basic program to provide the language Pascal?"

REPEAT loops, GO TO statements, pointers and variant records - features which Mr James feels to be 'specialised'. The book ends with the obligatory syntax diagrams, a few appendices and a very brief index.
As a tutorial in Pascal programming, the book is not outstanding. Like many others, Mike James places insufficient emphasis on data storage - a crucial feature of the language. The approach is strongly 'programming first, data afterwards' which is the opposite of the sequence in which most non-trivial problems should be tackled.
The book tries to justify the word 'micros' in its title by making references to small-computer implementations of Pascal. And yet the author fails completely to mention the best-selling HiSoft Pascal. Perhaps a future edition will mention HiSoft Pascal as well, making the book more attractive to Spectrum.
Pascal For Micros is fairly typical of the low-priced Pascal books now available. It scores over the others with its
relaxed, less academic style but, from the other side of the coin, suffers an occasional lack of precision and a rather uncritical approach.


In the last text I looked at, Jeremy Ruston entreats us to Learn Pascal On Your Basic Micro.
The book is actually based on quite a clever idea. Most people become interested in Pascal when they realise (or imagine) the limitations of the Basic interpreter built into their computer. Wouldn't it be fun, therefore, if we could write a Basic program to provide the language Pascal? It might also be cheaper than buying a full-blown Pascal compiler. The last 80 pages of this book consist of dot-matrix printouts of a 'Pascal compiler' for the Spectrum, BBC Micro or any standard 'Microsoft Basic' computer. You type your Pascal program into DATA statements and run the Basic to compile them.
The compiler translates a limited subset of the Pascal language into very simple Basic; consequently, the 'compiled' code runs at a very slow speed. It's printed up on the screen as it's generated, and (on the Spectrum) you have to copy it down and type it into the computer later, to test it. This makes it completely useless for serious programming, and its design for a range of computers means that it works very slowly indeed. The compiler is quite well-designed but it uses large amounts of subroutine calls and string handling, which the Spectrum handles at its usual torpid pace.
The first 10 chapters of the book make up yet another course on Pascal programming. I'm sorry to say that some of the assertions are downright wrong, especially early in the book; the discussion of data structuring completely ignores pointers, records, files, and sets. Also, in my humble opinion, Mr Ruston is a better programmer then he is a writer. But, if you're interested in the way a language compiler could be written in Basic for a group of computers, then perhaps the book is worth buying. The program certainly makes interesting reading, and neatly handled blocks and expressions. But if you want to learn Pascal, then forget it.
We looked at ...
Programming Languages for Micros
Garry Marshall, Newnes Technical Books
ISBN 0 408 011 858, £6.50
Pascal For Micros
Mike James, Newnes Technical Books
ISBN 0 408 012 498, £6.50
Learn Pascal On Your Basic Micro
Jeremy Ruston, Interface
ISBN 0 907 573 279, £5.95
Home Contents KwikPik