t-jacobs@utah-cs.UUCP (Tony Jacobs) (10/28/86)
Here is a blurb about the new version of Lightspeed that came from the Boston Computer Society meeting. 13318 1-OCT-23:42: Programming Report on LightspeedC 1.5 From: PEABO To: ALL The Boston Computer Society MacTechGrp had as its feature presentation tonight the public premiere of LightspeedC version 1.5. Michael Kahl of THINK Technologies, the author of the compiler, presented the product on the 6-month anniversary of the first shipments of version 1.0 There are many enhancements in version 1.5, and I'll mention them in the same order as they were demonstrated. First, many people have noted that the most time-consuming part of a test cycle seems to be relaunching Lightspeed after quitting the application. Version 1.5 provides instant "relaunch" by sensing when it has been initiated under Switcher and using Switcher to launch the program being tested in another partition. This means returning to LightspeedC takes place without noticeable delay when the application exits, and that if the application being developed is working well enough to run its event loop reliably, that you can switch back and forth between LSC and the application at will if you need to look at source code. The audience got quite a charge out of seeing LightspeedC running a development copy of LightspeedC, which in turn was running a small test application! (It requires quite a bit of memory to do that though, since it means having two copies of LSC plus the application in memory at once ... use at least one meg.) Next we saw a demo of the DA Shell, which is a small program that is automatically launched for testing Desk Accessories. It seemed to work very well (a similar program is used by Lightspeed Pascal to test DAs). One nice feature that was included is a Relaunch item on the menu of DA Shell, good for testing "goodbye kiss" logic. The Editor has a large number of nifty new features, many of them based upon taking advantage of the integrated edit-compile-link environment. Undo works! Mac Plus cursor keys work, with variations based on using shift and/or option. Syntactic checking is enhanced by use of a Balance command that highlights the portion of text that contains a balanced pair of parentheses, brackets, or braces. Combined with the Find command (on the { character) it can be used to step through your program text one function at a time, for example. Doing an option-double-click on the name of a globally defined variable causes the file containing the definition of that variable to open and the search function to be initiated for it. This uses information known to the linker for determining which module to open. Option-click on a source window title bar causes a scrolling menu of filenames included in the module to drop down from the title bar so you can open an included file without losing your insertion point (a problem with the Open Selection menu item of the original release). Zoom boxes are implemented on all windows, and there is a new Windows menu containing commands for bringing windows to the front (command key equivalents are Cmd-0 for the Project Window and Cmd-1 though N for the source windows). The Windows menu also contains clean up, zoom, close all, and save all. The Project window has some standard-file-like keyboard navigation tricks. Typing the first few characters of a module name selects the first occurence of a matching name, and Tab alternates among all names matching. Cursor arrows go up and down in the list, and Return opens the module for editing. HFS support has greatly improved. Where the original version LSC would search in only 3 HFS directories (the one containing the source file, then the one containing the Project file, and finally the one containing the compiler), the new version treats the subtrees anchored at those directories as the set of places to look. When a file is first found in this fashion, its directory location is remembered in the project so that it can be found more quickly the next time. If you subsequently move it, the tree search will be repeated to find it again. If you move a large number of files, or transport a whole project to another directory structure, you can easily rebuild LSC's recollection of the location of files by using the Use Disk option in Make to find all the files. You can also shield subtrees which would ordinarily be included in the search by placing them in directories whose names begin and end with parentheses (like "(backup)" for example). The full support of Inside Mac vol 4 HFS libraries, included definitions, and glue routines is now standard, and the UNIX-like stdio package has been modified to work in a Macish windowed environment in lieu of the white screen. The compiler's code generator has been improved by 4-8% space efficiency through the use of short branches. All backward branches are shortened if possible and the great majority of forward branches are as well. The compiler now supports inline assembly in a particularly slick fashion. Rather than just emiting assembly code in between #asm ... #endasm as most compilers do that have separate assembly phases, LSC integrates the semantics of assembly language into the syntax of C. The construct is asm {...} in the form of a block that can be used anywhere a C statement can, and the assembler code can reference global variables, local variables, function parameters, and even offsets into structures (using the macro OFFSET(structure-tag,field-name) in place of the byte offset in an instruction). Macro substitution uses normal C language preprocessor macros. We didn't see enough of the code to tell if there were any major syntactic differences from normal assembly language code, but there are a few nice things, like being able to omit the reference to A4/5 or A6 if the compiler sees the name of a global or local/parameter. You can even reference register variables by using the name of the variable! You can write your own glue routines by using the trapnames for register-based traps. A dc instruction is available for imbedding constants into the code segments. Jump and goto statements can be used to transfer between sections of C code and sections of assembler code. Break, continue, and return act as they would if they were used outside the asm block. Either C-like or assembler-like comment conventions can be used. The compiler also interprets and enforces function prototypes like extern pascal Handle abcfunc(short, char **, Handle); and checks calls to the function declared as a prototype for number of arguments, type mismatch, and need for coercion (i.e., longs and shorts will be coerced appropriately, so you don't wind up with strange errors in argument list offsets). A function prototype can also specify a tail of zero or more unchecked arguments, as is needed by the stdio routines fprintf, etc. The declaration void * is accepted as a pointer of unspecified and universally compatible type. Functions defined in a module which contains a previous prototype declaration get validated to be sure that the definition matches the declaration. There is not any way of emiting a prototype file of all the defined functions in your module though. You have to do that manually. The Options dialog (which used to be a separate menu item) now has some options to control whether protypes are required or not and whether type checking of pointers is done. While there are no prototype definitions for the Mac Toolbox, the validation used by the original LSC version still applies, and in addition the stdio functions have had prototype declarations placed in include files. LightspeedC 1.5 is being shipped to selected beta test sites next week, and with any luck will be available to registered owners around the end of October. The upgrade is FREE to all registered owners of LightspeedC, in appreciation for their early support. peter