To C, or not to C


Xav calls on a few friends to give Prospero a thorough workout against Lattice C - the self-styled king of compilers, with some surprising results...


I enlisted the help of fellow Kosmik Phish colleagues Anthony Jacques and Phil Hough. Anthony had just bought Lattice C, so we opted for a head-to-head review. In the red corner, we have Prospero C, weighing in at just under twenty pounds and in the blue corner we have Lattice C, weighing in at almost seventy.

Prospero's books

A C compiler lives or dies by its libraries - these are the pre-coded functions used to perform common tasks and their usefulness is directly related to the quality of the documentation.
Both have extremely well written library manuals, both split the manuals sensibly into Atari library calls and C library calls (the Prospero manuals are further divided to separate the AES and VDI functions) and both include code examples - although Lattice has more of them.
The Prospero manuals offer the advantage of spiral binding which means the manuals can lie flat or folded back on itself and they are arranged alphabetically which makes it easy to find a function if you have some idea of its name. The Lattice manuals, on the other hand, are grouped by header file, which makes it awkward to find the function you want.

Installation

Lattice is more flexible, supplied on seven double density disks, the installation program offers program files and headers for almost any configuration and takes care of deciding which files are needed for your own configuration, although it does give you some degree of control in providing check boxes to activate or deactivate parts of the software. Lattice also gets a bonus point for showing how much disk space your chosen arrangement will take. It's even possible to get the Lattice installation program to produce a list of the files you need, leaving you to copy them from the master disks yourself. Prospero's installation routine is so poor you're probably better off copying the files manually anyway but there is only one disk so it's not too tedious.

Get Shorty

Once you run the programs (finding the correct executable for Lattice is a challenge in itself) both packages display a vaguely familiar working environment. Both look dated which is understandable because neither have been updated for years. However, leaving modern GEM enhancements aside, I would have expected standardised keyboard shortcuts - programming is keyboard intensive. Unfortunately both programs use the "old" [Alternate] key combinations with Lattice offering function keys for cut, copy and paste operations and Prospero offering Wordstar compatible shortcuts - both positively archaic!

[Screenshot]
The dialogue at the front is K Resource's right button menu...


[Screenshot]
...whilst WERCS makes you access the menu bar for everything


However, Prospero does include one useful set of shortcuts, "macros" which can be assigned to the function keys. We're talking text strings here, and these provide the ideal way to sprinkle printf("This is a test") strings throughout your code.

[Screenshot]
Prospero's single options screen makes Lattice look like mission control


C is nominally a highly portable language - especially if you stick to a text based interface, as used in TOS/TTP applications. C was standardised by the American National Standards Institution (ANSI) back in the eighties but unfortunately the standard was still being ratified when Prospero was released - so it's almost, but not quite, ANSI compatible.

Lattice, in contrast, presents almost too many compatibility options. There are switches for strict ANSI compatibility, pre-ANSI code, C++ style additions, and many more. Thankfully it's safe to stick to the defaults for most purposes, although I suspect I won't be the last person to forget to enable the "Build GEM Application" switch which is tucked away in a dialog - in Prospero this option sensibly merits its own drop down menu entry.

Debuggers

Debugging utilities typically display compiled machine code in its assembly language form and offers options to step through the code one instruction at a time, or set it to run until it reaches a particular line with the ability to view the contents of the memory, registers, the stack, the status register, or any other part of the machine's internals. Debuggers are hard going, requiring an understanding of the workings of a microprocessor, and comprehension of the terse mnemonics of assembly code. Nevertheless, they do provide the last line of defence against persistent bugs.

Lattice's debugger, Mon, enables the assembly language and its C source, to be viewed side by side but all the real work has to be done at the assembly level. Mon is very powerful, but intimidating. On the other hand for anyone capable of hacking at assembly level, the hostile interface isn't likely to put them off.

[Screenshot]
Lattice's general options screen - and there are another dozen of similar complexity


Prospero's debugger is less powerful but does offer enough features to be useful and benefits from better online help. At first it seems a little too clean cut but on closer inspection there is more to this debugger than meets the eye and we all ended up preferring it to Mon for "first encounter" debugging sessions.

Prospero floating point support is barely non-existent compared with Lattice which supports almost every combination of hardware and software - including the odd implementation of the MegaSTe.

Untapped Resources

Both programs are capable of producing GEM applications, Lattice includes the WERCS resource construction set and Prospero supports K Resource, from Kuma, which is available as part of the Developer's Kit - although this costs the same as the compiler itself.

WERCS is satisfactory for simple GEM applications but its interface soon becomes tedious when working on large projects. It hasn't been updated recently and although it does support the 3D look there's no support for TOS 4 colour icons or many of the enhanced GEM objects we've come to expect in modern GEM applications.


[Screenshot]
Lattice's project manager makes working with multiple source files relatively painless


[Screenshot]
Using either of these programs requires you to learn non-standard keyboard shortcuts...


[Screenshot]
...but at least Prospero does something useful with the function keys


K Resource is even older than WERCS, so we weren't expecting much from it. We were pleasantly surprised to find a user interface that made the picking and placing of objects simplicity itself, due to a right-click popup and a drag and drop system. Although written years before the advent of TOS 4, the programmers had the foresight to include check boxes for the extended object flags which means, if you know what you're doing, you can create the 3D look. Sadly colour icons are not supported.


[Screenshot]
It may show its age, design wise, but at least K Resource lets you access the extended object flags


However, with the availability of Interface and ResourceMaster purchasing one of these instead of the Developer's Kit might be a better option.

And the winner is...

It was surprisingly difficult to choose between these programs because they will appeal to different ends of the market. For the serious coder, requiring flexibility, it has to be Lattice.

In some respects Prospero draws surprisingly close to Lattice, despite its considerably smaller size. Oddly, the lack of a resource editor might work in its favour if the user prefers to use an alternative. If you're just starting out in C, and want the comfort of a GEM interface and the support of some excellent reference books, Prospero is a bargain.


SIZE ISN'T EVERYTHING


The Prospero executable is smaller than the Lattice equivalent because Lattice generates optimised machine code. We wondered quite how dramatic the difference would be, so we wrote a simple for loop, with an addition at its core, to serve as the basis for a time trial. The executables from each compiler were then run through a profiler, in order to determine how long each took to finish the loop. Lattice took 0.5 seconds compared with Prospero's 1.5 seconds.
Clearly Lattice's code was faster, but the generated executables were approximately the same size. We wondered what the effects would be on a more realistic application - something that uses GEM. In order to ensure compatibility between the two programs (which have slightly different GEM libraries), we kept the code simple. The test program simply draws a filled circle, then exits. This time around the execution speeds were similar, but the compile time and resultant file sizes showed marked differences.
Using Lattice our test program compiled a file 4762 bytes long in 9 seconds compared with a file 15360 bytes long which took 35 seconds to compile using Prospero.



THE BEST THINGS IN LIFE ARE...


One of the most powerful compilers, GCC (Gnu C Compiler) is available free of charge. Unfortunately it's not a GEM application so you need to be comfortable working from a command line interface. A good MiNT based system does make things easier and, if you've got enough disk space, it's possible to install MiNT and GCC in one go, along with lots of other Unix-like programs. Look for KGMD (Knarf's German MiNT Distribution).
Alternatively there's another command line based compiler called Sozoban C. Newer releases (look for Sozoban X) offer installation routines and better GEM libraries. Of course, you'll still need library manuals - or the stamina to wade through the supplied documentation and header files.



LATTICE C V5.5

[] Publisher:
HiSoft
Tel: +44 (0)1525 718181
Cost: £65

[] Requires:
Any Atari, 1Mb memory, DS floppy
[] Pros:
More power than you'll ever need. Probably
[] Cons:
Dated in parts. Can appear confusing

80%


PROSPERO C

[] Distribution:
UK: Goodman's
Tel: +44 (0)1782 335650
Cost: £19.95

[] Requires:
Any Atari, DS floppy
[] Pros:
Clear and simple interface. Small enough to use from a floppy
[] Cons:
Lacks flexibility, no resource editor

75%


PROSPERO DEVELOPER'S KIT

[] Distribution:
UK: Goodman's
Tel: +44 (0)1782 335650
Cost: £19.95

[] Requires:
Any Atari, DS floppy
[] Pros:
Clear and simple resource editor
[] Cons:
Quite expensive for its age and capabilities

60%


[Home] [Info] [Back] [Next]