Path: news.uh.edu!barrett From: alien@acheron.amigans.gen.nz (Ross Smith) Newsgroups: comp.sys.amiga.reviews Subject: REVIEW: DICE C compiler, version 3.0 Followup-To: comp.sys.amiga.programmer Date: 13 May 1994 18:29:44 GMT Organization: The Amiga Online Review Column - ed. Daniel Barrett Lines: 462 Sender: amiga-reviews@math.uh.edu (comp.sys.amiga.reviews moderator) Distribution: world Message-ID: <2r0guo$da0@masala.cc.uh.edu> Reply-To: alien@acheron.amigans.gen.nz (Ross Smith) NNTP-Posting-Host: karazm.math.uh.edu Keywords: programming, C, compiler, commercial Originator: barrett@karazm.math.uh.edu PRODUCT NAME DICE 3.0 BRIEF DESCRIPTION C compiler and integrated development environment for the Amiga. AUTHOR/COMPANY INFORMATION Name: Obvious Implementations Corporation Address: PO Box 4487 Cary, NC 27519-4487 USA Telephone: (800) 761-2042 E-mail: info@oic.com LIST PRICE Standard purchase price: $150.00 (US) Student price: $95.00 (US) For SAS C owners: $95.00 (US) For registered owners of DICE shareware: $75.00 (US) Currently, DICE 3.0 is available directly from OIC only; it is not distributed through any other source. It can be ordered by mail from the address above or by calling the 800 number if you have a Visa card. (Never send your credit card number to anyone by email! There are too many people who could read it along the way.) The shareware version of DICE is no longer available. See below concerning the freeware version. SPECIAL HARDWARE AND SOFTWARE REQUIREMENTS HARDWARE Requires 1 MB RAM. (DICE 3.0 uses 1.5 to 8 MB; see "Installation"). Hard drive recommended but not required. No CPU restrictions. SOFTWARE Requires AmigaDOS 1.3 or better. Works fine under AmigaDOS version 2 and 3. A few features require AmigaDOS 2.0 or better. COPY PROTECTION None. MACHINE USED FOR TESTING Model: Amiga 2000HD Processors: 25 MHz 68030 CPU, 68882 FPU Chipset: PAL ECS RAM: 5 MB (1 MB Chip, 4 MB Fast) Hard drive: Quantum 50 MB internal SCSI Floppy drive: One internal 880K Monitor: Commodore 1084S Operating system: 3.0 Beta (Kickstart 39.106, Workbench 39.29) INSTALLATION DICE 3.0 comes on five disks. Installation is done by the Commodore Installer program. There are three Installer scripts with icons on Disk 1 of the distribution. One installs DICE on your hard drive, a second installs it on floppy disks, and the third creates the freeware version (see below). The hard drive installation works perfectly. It offers an assortment of options -- whether to install the 1.3, 2.0, and/or 3.0 header files and link libraries; whether to include all, none, or a selected subset of the examples; which editor to install; and so on. Anything not selected in the initial installation can be added later; an option in the Installer script allows the addition of selected modules to an existing installation. Unlike some badly-written installers, DICE's installation process is very careful never to change or replace any existing files without explaining exactly what it's going to do and waiting for permission. Depending on which options you select, DICE can take up anywhere from 1.5 to 8 megabytes of hard drive space. Mine took up 4.7 megs, which is probably a fairly typical amount; few users are likely to need the full 8 megs (which assumes, for example, that you install all three complete sets of includes and libraries). Incidentally, although the installer and the manual refer to "3.0", the include files actually supplied are version 3.1. The freeware DICE is a freely distributable version of the compiler with floating point support and some Amiga-specific features disabled, but otherwise a perfectly good C compiler. Users are encouraged to distribute the freeware version, which consists of the compiler, link libraries, standard C include files, and the relevant documentation -- no editor or any other tools (though DME can be found on a Fred Fish disk). The freeware version Installer script attempts to install DICE onto a single floppy, which doesn't work -- it's about 1.3 megs and needs two (I guess they must have tested it on an Amiga 4000 with high density 1.76 MB drives and forgot that most Amigas only have 880K drives). This is easy to get around if you're running the installation on an Amiga with a hard drive: just create a drawer on your hard drive and assign "Freeware_Dice:" to it before you start. (You'll still need a spare floppy for the install script to format, though.) Afterwards, you can split the installed files between two floppies. You can't run the freeware installation on a floppy-only system. COMPILER The actual compiler is changed little from the shareware version of DICE, apart from a few enhancements (mostly related to the VMAKE interface -- see below) and bug fixes. Anyone familiar with the shareware DICE will find no surprises here. The compiler was designed with quick and reliable code generation as the primary goal, with optimisation secondary. That's not to say DICE does no optimisation; it doesn't do the kind of aggressive optimisation performed by GCC or SAS C, but it produces perfectly good code for all but the most demanding cases (where most programmers would probably switch to assembly language anyway). The DICE compiler, DCC, is almost entirely conformant to the ANSI/ISO C standard, which is only to be expected these days. There are a very few features and functions omitted, such as the atan2() function, and a large number of enhancements. Compiler features include precompiled header files, automatic generation of function prototypes, profiling (a special set of link libraries that allow you to keep track of exactly how much run time each part of your program is taking up), and a "typeof" operator. Most of the enhancements, of course, are related to writing Amiga-specific code. These include automatic opening and closing of shared libraries; the "__chip" type qualifier to force data into Chip RAM; dynamic stack checking (which automatically gives your program more stack space when it runs short); the "wbmain()" function (giving a program different entry points depending on whether it was started from the Shell or Workbench); full control over parameter passing via registers or stack; and an extensive set of functions that make giving your program an ARexx interface fairly painless. The DICE package includes the complete set of include files and link libraries for Workbench 1.3, 2.0, and 3.0/3.1. INTEGRATED DEVELOPMENT ENVIRONMENT The centrepiece of the whole system is VMAKE, which, as you might expect from the name, is a visual "make" tool. It's really an integrated development environment. You create a "Project" and tell VMAKE what source files belong to it. VMAKE gives you access to the editor of your choice (see below), compiler, debugger, and help system. Compiler options are selected through VOPTS, which is basically a GUI for DCC -- you use the usual Intuition tools (gadgets, list windows, and so on) to select the compiler options, link libraries, and so on. If you select a source file from VMAKE, the editor is invoked. Once you've written the source code and set the compile options, you hit the "Make" button to compile and link everything that needs it, then pick one of the "Run" options to test it (there are three options -- CLI, Workbench, or Debugger). VMAKE knows what to do with individual source files by looking at their names -- a name ending in ".c" is C code, ".a" is assembler source, and so on. It's smart enough to know not to compile a source file that hasn't changed since the last compile. If you get compile errors, the editor is automatically brought up with the cursor positioned on the line containing the first error; when you've fixed that, you hit Shift-F5 (or whatever alternative key you want to define) and the cursor is moved to the next error. The full list of errors is visible in another window. VMAKE is highly customisable. All the gadget and menu details are stored in plain text files rather than being hard-coded, and the formats are fully documented. You can rewrite, add, and subtract menus and gadgets to your heart's content. I have a couple of nitpicks with VMAKE. One concerns the "Save" options on VMAKE and VOPTS. Every time I make any changes and save them, I get a requester that warns me that I'll be overwriting my existing project, and do I really want to do that? Well of course I do, that's why I chose "Save". I'm all for safety measures in important things, but VMAKE has far too many "Are you sure?" requesters for my taste Surprisingly, given the impressive configurability of VMAKE in most respects, there doesn't seem to be any way to switch them off. My other complaint is that VOPTS causes an Enforcer hit every time it's invoked! (If you're not familiar with Enforcer, see below.) This is inexcusable in commercial software. It doesn't seem to cause any problems (it appears to be a dereferenced null pointer), but it's not exactly the most encouraging sign, especially since Enforcer is included in the DICE package. A feature I like a lot is DiceHelp. This is a program that takes the name of a C function, type, or include file, looks it up in the Autodocs, and opens a window to show you the documentation (if it finds any). DICE 3.0 comes with docs for the standard C and DICE-specific functions; if you have the Commodore Autodocs it will use them too. The installation program automatically creates the necessary ARexx scripts to integrate this with your choice of editor. You just move the cursor over the function name and hit F5; the editor opens a second window showing the relevant documentation. DEBUGGER DICE includes a source code debugger, DD. It can be used either standalone (from the command line) or through VMAKE. I'm not quite sure what to report about DD. Most of it seems to work; you can see the source code in a window, set breakpoints and so on, but it seems to be missing one of the most important features of a debugger: I can't find any way to inspect (or set) the value of a variable. (You can read the values of memory locations, but since there's no way of finding the address of a variable, that's not much help.) I say "seems to" because I can't believe OIC could have left out anything so important; but if it's there, it isn't documented, and I haven't been able to figure it out by trial and error. I'll reserve judgement on the debugger. EDITORS The DICE package includes two editors. DME is the standard editor that has been included with all versions of DICE. The new one is AME (Advanced Micro Emacs). I switched to AME immediately and haven't regretted it; it's basically all the good features of Emacs without the megabloat (less than 100K!). Many features are common to both editors: multiple windows, full ARexx support, programmable keys and menus, and all the usual features you'd expect in an editor (search and replace, clipboard support, paragraph formatting, and so on). AME has a few features not found in DME: multiple undo steps (although this still has a few bugs in it); the ability to open on its own screen or a public screen (DME opens only on the Workbench) and even jump to a different screen while running; and 16-bit character support. AME also has a "C mode" which is automatically invoked when you edit a file whose name ends in ".c". You can also switch it on manually. It provides programmer-friendly features like bracket matching (warning you if you enter a mismatched bracket). Besides its own two editors, DICE also supplies sets of ARexx macros for integrating VMAKE with Cygnus Ed and TurboText and promises to provide more editor options in the future. OTHER TOOLS Besides the compiler, editors, debugger, and VMAKE, a large number of other tools are supplied with DICE. RCS (Revision Control System) helps with the development of large projects. It keeps track of who is working on each source file, recording all changes to allow later reversion to an old version if necessary. I don't use this myself (it seems like overkill for one-person projects), but it would be extremely useful for large projects involving several programmers and many source files. (I program mainframes for a living, and we use a similar system in our work.) RCS is fully integrated with VMAKE. There is an assembler, DAS. It's designed primarily to be called by DCC as part of the compilation process, so its features are fairly minimal and somewhat specialised, but it can be used as a standalone assembler if you need one. Again, VMAKE knows about it. Mike Sinz's Enforcer is included. Enforcer is run in the background (most programmers put it in their s:User-Startup and leave it running permanently) and uses the MMU (Memory Management Unit) to watch for illegal access to certain regions of memory, such as the low page and nonexistent pages. With the help of auxiliary tools like SegTracker and FindHit (both included), you can often locate the exact line of code that produced such errors -- the classic example is a dereferenced null pointer. Enforcer works only on an Amiga with an MMU, which basically means a 68030 (not 68EC030) or 68040 CPU. Other tools include DOBJ, a disassembler; DPROF, a profiler for use with the profiling libraries; FDTOLIB, which creates link libraries from FD files; and many others. Massive quantities of source code are provided. The source for VMAKE and many of the other tools is present. There are also working examples of a shared library, an Exec device, a DOS handler, and a printer driver. DOCUMENTATION DICE 3.0 comes with a printed manual of about 450 pages. It's very tightly bound and won't lie flat; in fact, it's difficult to even hold it open with one hand. I recommend that the first thing any purchaser does is take the manual to the nearest printer and get it spiral bound (thanks to Liam Greenwood for the suggestion). It cost me NZ$4.00 (about US$2.50). I don't know why so many software publishers are unwilling to add the extra dollar or so to the price in order to have spiral binding. The manual is well-organised and fairly well written and should be equally useful to beginners and experts. The proof-reading occasionally leaves something to be desired, though. There are a few humorous comments of the "This page unintentionally left blank" variety. The manual begins with an outline of DICE's features and instructions for installing it, which amount to little more than "Put Disk 1 in the drive and hit the Install icon". This is followed by an introduction to C, which is probably a waste of space -- it's far too sketchy for a novice actually to learn C from it without a real textbook, and it is redundant if you have a real textbook. Next comes the description of VMAKE. This is thorough and easy to follow, although the section on VOPTS is missing (the relevant page just says "[TBA]", so I guess someone forgot to stick it in). This isn't a serious problem; if you read the section later in the manual that describes the compiler's command line options, it's pretty obvious how they correspond to the gadgets in VOPTS. The next sections cover the DICE compiler, the various tools and utilities, the two editors, and the online help system. Full documentation for most of these is also provided on disk. The biggest section of the manual is the function reference, which documents all of the standard C functions, as well as those specific to DICE. These are in the standard Autodocs format and are also provided on disk for use with DiceHelp. The last section will be very helpful to those new to C programming. It's a problem-solving guide that describes many of the most common errors made by C programmers and how to avoid them. There is a fairly thorough index. LIKES Installation: Painless and apparently flawless hard disk installation. Compiler: Very fast compilation; almost complete ANSI/ISO standardisation; useful extensions, especially the ARexx package. Editors: Ability to use several editors; extensive customisation capability; multi-window and multi-screen capability in AME; ARexx interface. Development environment: VMAKE gives access to everything you need for development; Style Guide compliant interface; fully customisable and extensible; excellent online help system. DISLIKES AND SUGGESTIONS Installation: Freeware version installation doesn't work properly. Editors: Buggy "undo" in AME; AME opens on the Workbench by default when you invoke it from VMAKE, which is annoying. It has always mystified me why so many people write editors that insist on taking over the Workbench, when opening their own screen is so easy. Development environment: Major missing feature in debugger (this is my only really serious complaint); Enforcer hit in VMAKE/VOPTS; annoying "Are you sure?" requesters. Suggestions: Apart from bug fixes, I'd like to see an "off" switch for VMAKE's annoying requesters. You can edit VMAKE's options to make AME use its own screen, which I prefer, but it takes some digging in the documentation to figure out how to do this; it should be easier (or, better yet, the default). A good, standalone assembler would be very useful. The manual says at one point that A68K is included, but it isn't; I guess it got left out at the last moment. One major feature I'd like to see is some sort of interface designer. Most compilers on the PC and Mac come with GUI design toolkits; we're always saying how marvellous the Amiga's interface is, so why are there so few GUI tools for the Amiga? GUIs have been around long enough now that it's about time compiler vendors started thinking of interface toolkits as part of the necessary minimum standard rather than an optional extra. COMPARISON TO OTHER SIMILAR PRODUCTS The other C compilers I have used are GCC on the Amiga and Borland C++ on the PC. Comparison to Borland C++ is hardly fair, given the very different markets the products are aimed at; I don't think it counts as a "similar product". GCC has the obvious advantage of being free. DICE's user interface is so much better there's no comparison. GCC is ported from UNIX and takes the standard UNIX "user friendly is for wimps" attitude. DICE is much smaller and faster; GCC produces better optimised code. Both include many additional tools and extensive online documentation; DICE's is better organised and easier to use. GCC includes C++ as well as C. DICE has many features adapted for writing Amiga-specific code; GCC has practically none. Executables produced by DICE are the property of the writer and can be distributed under whatever terms you choose, whereas those produced by GCC are subject to the General Public Virus, sorry, Licence. [MODERATOR'S NOTE: I am not sure that Ross's statement about GCC and the GNU Public Licence is correct. I am checking it out. - Dan] DICE's natural competitor is SAS C, which I've never used. SAS is far more expensive; I gather it includes counterparts to most of the tools provided with DICE. SAS's editor is reputed to be fairly minimal, whereas DICE includes two full-featured editors; but there are enough good editors available in the commercial, shareware, and PD worlds that this is probably not an important consideration. SAS includes some C++ features, although since it lacks templates and exceptions it can't be considered a serious C++ development system). DICE is plain C only. Like GCC, SAS does much better optimisation than DICE; I don't know how it compares in compilation speed, or whether it includes the equivalent of VMAKE or an interface toolkit. I assume SAS's debugger works properly. BUGS I've described the few bugs I found elsewhere in this review. I've contacted the support address about the debugger problem and the Enforcer hit but have received no reply so far. VENDOR SUPPORT Internet, Compuserve, and US Mail addresses are given for support. Although I've received no reply after a couple of weeks to my query about the debugger, I have received very helpful replies to some questions about AME. WARRANTY None. CONCLUSIONS Overall, despite a few minor niggles and one major one, I like DICE. The compiler is very fast, and produces good enough code for all but the most speed-critical applications, and the other tools are well-chosen, well-designed, easy to use, and highly customisable. I recommend DICE 3.0 highly to anyone interested in C programming on the Amiga. I give it 8 out of 10, rising to 8.5 if they fix that hole in the debugger and the Enforcer hit in VOPTS. COPYRIGHT NOTICE Copyright 1994 Ross Smith. All rights reserved. This review is freely distributable. Ross Smith (Wanganui, New Zealand) ... alien@acheron.amigans.gen.nz GCS/S d? p c++++ l u-- e- m---(*) s+/++ n--- h+ f g+ w+ t+(-) r+ y? Keeper of the FAQ for rec.aviation.military "Well, we know what to get you for Christmas. A double lobotomy and ten rolls of rubber wallpaper." (A J Rimmer) --- Daniel Barrett, Moderator, comp.sys.amiga.reviews Send reviews to: amiga-reviews-submissions@math.uh.edu Request information: amiga-reviews-requests@math.uh.edu Moderator mail: amiga-reviews@math.uh.edu Anonymous ftp site: math.uh.edu, in /pub/Amiga/comp.sys.amiga.reviews