Path: utzoo!mnetor!uunet!husc6!endor!olson From: olson@endor.harvard.edu (Eric K. Olson) Newsgroups: comp.sys.mac Subject: Re: LightSpeed C gripes Message-ID: <3813@husc6.harvard.edu> Date: 15 Jan 88 20:19:31 GMT References: <10928@duke.cs.duke.edu> Sender: news@husc6.harvard.edu Reply-To: olson@endor.UUCP (Eric K. Olson) Organization: Lexington Software Design Lines: 117 Keywords: LightSpeed C no good, Mac 2, Gnu Chess In a recent article Michael Gleicher writes: >I recently purchased LightSpeed C (2.11, upgraded to 2.15 from over the >net upgrades), and I must say it is one of the poorest products that I >have seen for a computer. > >1) The documentation is awful. [...] I didn't notice, but then again, I didn't read it. >2) The editor sucks and you're stuck with it. > The editor is so bad it isn't worth mentioning. Little things > like a key to go to the end of a line, clear to end of line. Top, bottom of file: option-uparrow, option-downarrow Left, right of line: option-leftarrow, option-rightarrow To make any of the above "select from cursor to {top,bottom,left,right}" hold down the shift key also. To do "delete from cursor to {top,bottom,left,right}" do option-shift-arrow followed by delete. By extension: Find from cursor is Cmd-F, find from top of file is option-uparrow Cmd-F. If you start in the middle and can't find your string, hit option-uparrow Cmd-A to wrap the search to the top (and all the way to the bottom again). > I thought that under Multi-Finder I'd have MicroEmacs 3.8m (a > good editor with the mac interface) or some other thing running > side-by-side. But this won't work because lightspeed keeps everything > in memory. True. If you don't like LSC's editor, you have no real alternatives. >3) The system is extremely limited by memory constraints. > If I wanted to be limited to small code/data segments I'd have > saved $3000 dollars and bought a 386 PC. But I want to be able to > run Big programs on my Mac 2. I don't want to see Code Segment > too large, although this is bearable considering the Mac loader. > What isn't acceptable is seeing "Data Segment too Big". I like to use dynamic memory allocation in the spirit of the Macintosh. (I'd like to use Handles all the time, but I'm too lazy). I realize that this is a difficult concept for people used to virtual memory, but it makes sense in a non-VM environment. Try: char c[] = NewPtr(32000*sizeof(char)); instead of char c[32000] as suggested in a recent posting. I believe this limitation exists in most development environments for the Macintosh. Last time I used MPW C it had the same problem; this may have been fixed. If it is fixed, it's probably just by doing the above for you. You certainly don't want 32K of uninitialized data in your Application file! >4) The system doesn't really handle Multi-Finder. > Under multifinder, I keep getting "Out Of Memory" when I try to > compile programs (the program is about 2800 lines long in one > file). Big programs won't run either. Increase the partition of LSC by doing a Get Info in the Finder while LSC is not running. You can also increase the partition of the Project when run from LSC by putting a SIZE resource in the _Project_ file (not the Project.rsrc file). SIZE -1 is the default setting, SIZE 0 is the setting in the Get Info Box. I'm not sure which LSC uses, you might as well set both. These have to be put in using ResEdit (which has a template for SIZE resources), the Finder will only do applications. You should also put SIZE resources in your Project.rsrc file. These will be used only when you actually build the application into a file. >7) The error messages are useless. > The compiler stops on the first error. It gives this obnoxious > box to click in. The messages aren't too useful. It doesn't show you > exactly where the error is. It shows you the beginning of the logical line in which the error was flagged. It can be confusing if the problem is a missing ; or mismatched {}. I wish the error box would go away with a click anywhere, but have gotten used to hitting return (which makes the box go away) after hearing the beep because I moused outside of the error box. Then the mouse is still in position, and I just click it again. >Also, what I've been trying to do is to take a UNIX/MSDOS program >(GnuChess) and get it to run on the Macintosh. This is probably not >what lightspeed was meant for. Porting code for the PC or Unix is difficult because of the one-dimensional nature of unix (and the PC). They expect to communicate to the user with a stream of characters, and get data via a stream of characters. The Mac, on the other hand, communicates via a two-dimensional drawing, and gets most of its input via a two-dimensional pointing device. I've noticed that programs that try to use a character-oriented window running a character-oriented i/o scheme on the Mac are not accepted by the user community. Witness the AdvSys package and the anagram generator (Ars Magna), which I've never seen anyone else use [notable exceptions: Describe, because it was so useful and brief, and MPW, because it is so nicely done, and not overly one-dimensional]. It sounds like you should be using MPW (which even has a GreenHill C compiler), or A/UX if you want to run Unix. LSC is (in my opinion) ideal for programming Macintosh software. I never use the C libraries (I use Macintosh calls and C syntax essentially), cetainly not the Unix simulation libraries. I use P-strings exclusively, and have written my own string library. This is a very powerful environment, and since I can use ResEdit at the same time under MultiFinder, I use resources extensively with vitually no pain. -Eric (defun maybe (x) (maybe (not x))) Eric K. Olson olson@endor.harvard.edu harvard!endor!olson D0760 (Name) (ArpaNet) (UseNet) (AppleLink)