Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oracle!news From: pnakada@oracle.com (Paul Nakada) Newsgroups: comp.sys.apple Subject: Re: C on the apple Message-ID: Date: 16 Jan 90 07:25:52 GMT References: <6695@wpi.wpi.edu> <12647@cbnewsd.ATT.COM> <6761@wpi.wpi.edu> Sender: news@oracle.com Organization: Oracle Corperation, Belmont, CA Lines: 99 In-reply-to: greyelf@wpi.wpi.edu's message of 15 Jan 90 23:02:08 GMT In article <6761@wpi.wpi.edu> greyelf@wpi.wpi.edu (Michael J Pender) writes: I'm looking for a good version of C for the Apple. I have a 3.5 inch drive, a Laser 128ex (3.6MHz), and a 256K ramcard in slot 5. The usual mouse, built in drive, modem, etc... I want to write routines in C, compile them, and use the object code generated as a program under Prodos. I need to be able to use very fast code under prodos for a project I'm working on. I would use pascal if I found a version that worked under Prodos with a minimum of necessary memory taken up. But I need to learn C for a class here at school anyway. I had Hyper C, but didn't know how to get started using the c language, and quickly became irritated trying to write a program on the tiny space alloted on the system disk. I want something that can make use of a 3.5 inch drive. So, are there any good C compilers under Prodos that are cheap (read poor college student). tanks in advance - Mike. Mike, To make a long story short. NO. There are no `good' C compilers for the non GS line.. I have seen and used Aztec, HyperC, and Orca Small C. There are most definitely other C compilers for the 65c02 //'s out there, but these represent the 3 most common approaches to structured languages on 8 bit platforms. My system. //c with 8mhz zip chip (effective speed 5.6 mhz) 2 5.25" floopies 1 800k floppy I will summarize: a note on p-code vs machine code. p-codes are single byte instuctions which translate to multi byte instructions with the aid of an interpreter. generated p-code from now on refers to "interpreted" and should be viewed as a tradeoff between more space for code and less speed. Aztec C. A full blown C as per the Kernighan & Ritchie book. Probably the most complete C compiler available on the market. Can compile to 6502 assembly or to p-code. Includes standard IO (stdio) libraries for portability (ha ha) across platforms. Prodos compatible and very very slow. Supports records, int, long, char, pointers and unsigned versions. HyperC. (shareware version) A subset of C yet fairly complete. Compiles to a native format disk using native OS. I assume it compiles to P-code. This is perhaps the fastest of the the 3 compilers. Speed can be attributed to the specialized os and limited subset of full C. This is the sketchiest of the 3, because of lack of documentation. Any HyperC hackers care to add? supports ?? datatypes. Small C. This is my favorite. This compiler is for people already familiar with both C and 6502 assembly, because it is the perfect too for learning the basics of compiler design. Small C is an extremely limited subset of C. I has one two data types, int and pointer. Both occupy the same number of bytes (in Orca Small C 4 bytes) Source code for the compiler is provided and is portable to much more powerful machines. It compiles to p-code, which when assembling using the orca assembler, compiles to p-code codes or straight 6502. The orca environment provides a linker to link program segments (which can be mixed between C, assembly, and any other compiler for the orca environment) prodos compatible, very flexible, and most important, educational. I have ported the compiler to a Sun 4, so modifications to the compiler are trivial. Compile time on the Sun is under 2 seconds. assembly time on my 8 mhz //c is considerably longer. Like I said to make a long story short. You will find that the most important aspect of learning C is a quick compile time and a less than hostile development. I would suggest investing in a 2400 bps modem (which you probably have) and using a mini-computer account. I would also heartily suggest using emacs, the emacs "compile" command and the gdb integrated debugger from within emacs. Once you've become familiar with the C Programming language, you will be able to see the limitations of implementing C on an 8 bit machine. I have found that no matter how much I appreciate and love my 8-bit apple //c, there's a time to put my apple // pride aside and use it as the best damn terminal emulator out there. :-) I really hope this helps.. -Paul Nakada pnakada@oracle.com