Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!oliveb!Glacier!decwrl!sun!chuq From: chuq@sun.uucp (Chuq Von Rospach) Newsgroups: net.micro.mac Subject: Re: binary postings (Re: net.sources.mac and shareware (...)) Message-ID: <3013@sun.uucp> Date: Wed, 20-Nov-85 12:42:31 EST Article-I.D.: sun.3013 Posted: Wed Nov 20 12:42:31 1985 Date-Received: Sat, 23-Nov-85 01:03:15 EST References: <2998@sun.uucp> <2237@amdahl.UUCP> <6693@boring.UUCP> Distribution: net Organization: Sun Micro -- NFS Consulting Group Lines: 65 > a) a list of differences between various compilers > b) guidelines for writing "portable" Mac programs > c) automatic conversion programs for certain compiler pairs Well, there are three potential problems you run into, just looking at the C compilers: o incompatible libraries - the different C compilers have implemented the Toolbox interfaces using different capitalization schemes, so GetNextEvent() in Mac C may be getnextevent() in megamax. I think that they are slowly working towards fixing this, but some of the compiler writers evidently couldn't help "improving" on Inside Mac. o incompatible assemblers - different compilers support different forms of inline assembler, or don't support them at all. They have also developed their own object formats rather than standardizing on Apple's MDS format. o incompatible toolbox interfaces - This is the kicker. Some systems try to bury their toolbox interfaces, either by doing string conversions and other things within the library or using a special function calling (Sumacc hides the Toolbox incompatibilities as much as possible, Megamax uses a special pascal function definition type). Others (Mac C, for example) simply lets the programmer figure out how to do the interface with a small glue routine. At one point I was porting example from Sumacc to Mac C. The only place I had any problem at all was where Sumacc and Mac C had different ideas of talking to the Toolbox. Mac C lets the programmer do it, Sumacc tries to help, and occasionally gets in the way because of it. I finally stopped due to lack of time (I may finish it Real Soon Now) but not until I came to the realization that these differences were enough that I couldn't just use an ifdef to define between the compilers, and Sumacc and Mac C are quite close to each other. I'm currently looking at rewriting SKEL into Mac C, but it'll be from scratch instead of a port because there are major differences in the details of the code. I don't see how that can be automated, offhand. > d) [this is working in a very different direction] > the definite compiler review showing that we should all use > brand X For C compilers, I like Mac C. Why? It was one of the first on the market. It reads MDS assembler, meaning that you can use anything shipped out of apple. It reads MDS object files, meaning you can use any of the Apple supplied libraries (like MacinTalk). Version 4.0 has a new optimizing linker that gets rid of dead code, meaning smaller applications. It also no longer needs MDS, so you don't have to buy anything else to make it run, so the cost isn't outrageous now. The Mac C people have also tried to not improve on the Inside Mac definitions so you don't have to do as much translation from the documentation to reality. There is also now a book out called "Using the Macintosh Toolbox with C" by three guys from Berkeley that is wonderful (review pending -- I just got it, but a mini-review is "BUY IT. NOW.") My second choice would be Sumacc, but everyone doesn't have access to a good cross development environment. I've looked at a fair amount of Megamax code, and I don't happen to like it because they've taken a lot of liberties with toolbox names that give me headaches trying to convert back and forth. -- :From catacombs of Castle Tarot: Chuq Von Rospach sun!chuq@decwrl.DEC.COM {hplabs,ihnp4,nsc,pyramid}!sun!chuq Let us now take the sacre oath. As of now, he is no longer an elephant!