|
|
||||
|
||||
|
|
|
|||
|
Santa Claus <santa@northpole.com> wrote:
> Is there a way to convert objective-c to c using mac os-x 10.4.2 and all > the latest compilers? (gcc 4.0, xcode 2) If so, how? The short answer: no. The long answer: the only ObjC-to-C translator that's still in existence is POC. Gcc's ObjC compiler is a direct compiler, with no intermediate C code. POC's dialect of ObjC is significantly different from gcc's, and there is no hope of it compiling anything which uses any of Mac OS X's Objective-C APIs. Why do you want to do this? -- Michael Ash Rogue Amoeba Software |
|
|||
|
In article <1127256387.54158@nfs-db1.segnet.com>,
Michael Ash <mike@mikeash.com> wrote: > Santa Claus <santa@northpole.com> wrote: > > Is there a way to convert objective-c to c using mac os-x 10.4.2 and all > > the latest compilers? (gcc 4.0, xcode 2) If so, how? > > The short answer: no. > > The long answer: the only ObjC-to-C translator that's still in existence > is POC. Gcc's ObjC compiler is a direct compiler, with no intermediate C > code. POC's dialect of ObjC is significantly different from gcc's, and > there is no hope of it compiling anything which uses any of Mac OS X's > Objective-C APIs. > > Why do you want to do this? I want to compile some programs using cocoa with the fpc pascal compiler. translating the obj-c into c is the first step in understanding how to implement this. |
|
|||
|
Santa Claus wrote:
> In article <1127256387.54158@nfs-db1.segnet.com>, > Michael Ash <mike@mikeash.com> wrote: > >> Santa Claus <santa@northpole.com> wrote: >>> Is there a way to convert objective-c to c using mac os-x 10.4.2 and all >>> the latest compilers? (gcc 4.0, xcode 2) If so, how? >> The short answer: no. >> >> The long answer: the only ObjC-to-C translator that's still in existence >> is POC. Gcc's ObjC compiler is a direct compiler, with no intermediate C >> code. POC's dialect of ObjC is significantly different from gcc's, and >> there is no hope of it compiling anything which uses any of Mac OS X's >> Objective-C APIs. >> >> Why do you want to do this? > > I want to compile some programs using cocoa with the fpc pascal > compiler. translating the obj-c into c is the first step in > understanding how to implement this. You still didn't answer the question ![]() -- My mouth says the words, my brain is thinking monstertrucks. Joey (Friends) |
|
|||
|
Santa Claus a écrit : > Is there a way to convert objective-c to c using mac os-x 10.4.2 and all > the latest compilers? (gcc 4.0, xcode 2) If so, how? Did you try the "Preprocess" command of XCode ? (=> action in the menu bar) |
|
|||
|
Santa Claus <santa@northpole.com> writes:
> I want to compile some programs using cocoa with the fpc pascal > compiler. translating the obj-c into c is the first step in > understanding how to implement this. It's not even a necessary step, much less the first. Have a look at Apple's guide to the Objective-C language and their runtime: http://developer.apple.com/documenta...veC/index.html http://developer.apple.com/documenta...Ref/index.html In case those links wrap: http://tinyurl.com/yw3t http://tinyurl.com/b4u54 There are two sides to it. First, sending a message to an object - that's done by calling objc_msgSend(), or one of that function's variants. The other part of it is registering your FPC classes with the runtime. That means building up a structure that describes the class object, and calling objc_addClass(). Then you can add methods to the class in a similar manner, filling out a structure that describes them and calling class_addMethods(). sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net Hire me! My resume: http://www.dot-app.org |
|
|||
|
"stao222@gmail.com" <stao222@gmail.com> writes:
> Santa Claus a écrit : > >> Is there a way to convert objective-c to c using mac os-x 10.4.2 and all >> the latest compilers? (gcc 4.0, xcode 2) If so, how? > > Did you try the "Preprocess" command of XCode ? (=> action in the menu > bar) That won't help. Like someone said earlier, GCC doesn't translate to C as an intermediate step, it compiles Objective-C directly. The above command will run the C preprocessor, which expands #import, #define, and other directives and macros. sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net Hire me! My resume: http://www.dot-app.org |
|
|||
|
Michael Ash <mike@mikeash.com> wrote:
> Santa Claus <santa@northpole.com> wrote: >> Is there a way to convert objective-c to c using mac os-x 10.4.2 and all >> the latest compilers? (gcc 4.0, xcode 2) If so, how? > > The long answer: the only ObjC-to-C translator that's still in existence > is POC. Portable Object Compiler (POC) compiles Objective-C into C. See http://users.pandora.be/stes/compiler.html > POC's dialect of ObjC is significantly different from gcc's, Yes, POC is better, with features like Blocks (closures) that more old-fashioned compilers like Apple's Objective-C are still lacking. The problem may be in the root class NSObject of Apple. The normal Objective-C compilers do not use NSObject, but rather Object as root class, so that will indeed be a show-stopper but this "show-stopper" is more of a library runtime issue (the root class) and not the compiler per se. |
|
|||
|
In article <hMiZe.4145$cm4.157835@phobos.telenet-ops.be>,
David Stes <stes@dD5E02985.access.telenet.be> wrote: >Michael Ash <mike@mikeash.com> wrote: >> Santa Claus <santa@northpole.com> wrote: >>> Is there a way to convert objective-c to c using mac os-x 10.4.2 and all >>> the latest compilers? (gcc 4.0, xcode 2) If so, how? >> >> The long answer: the only ObjC-to-C translator that's still in existence >> is POC. > >Portable Object Compiler (POC) compiles Objective-C into C. >See http://users.pandora.be/stes/compiler.html > >> POC's dialect of ObjC is significantly different from gcc's, > >Yes, POC is better, with features like Blocks (closures) that more >old-fashioned compilers like Apple's Objective-C are still lacking. Suffice it to say that POC is a niche compiler, whereas Apple's and GNU's GCC is the mainstream one. There are excellent reasons for this. It should be noted that POC 'supports' certain features - really, proprietary extensions - that have never been part of the Objctive-C language but which David Stes likes, but at the same time fails to include several features which have been part of Objective-C for about a decade now (things like Categories and Protocols) as well as of course anything that has been added over the past couple of years, like exceptions. Even its own proprietary extensions are often implemented badly and incorrectly: for instance, POC's attempt at exception handling using Blocks, which is supposedly modeled after Smalltalk's exception handling, doesn't actually implement proper exception handling semantics. In general, one should be somewhat wary of any claims that David Stes makes about the superiority of his personal hobby compiler - not just because he is inevitably biased, but also because of the significant number of flaws that have been exposed in it, including a number which he appears to not even understand. >The problem may be in the root class NSObject of Apple. > >The normal Objective-C compilers do not use NSObject, but rather Object as >root class, so that will indeed be a show-stopper but this "show-stopper" >is more of a library runtime issue (the root class) and not the compiler per se. Again, David Stes is, perhaps deliberately, confusing things. 'Normmal' Objective-C has in fact never mandated or included any specific root class. Quite the contrary, Objective-C allows developers to design and write their own root classes as necessary. There have been, through the lifetime of Objective-C, different class lbirariies available from different sources, and different ones of these have reached narrower and wider audiences, respectively. Stepstone did indeed distribute a class library, ICPak101, along with their compiler at one point, which included a root class named 'Object'; POC includes a class library called 'ObjPak' which attempts to mimic ICPak101. However, other developers of Objective-C compilers have shipped other class libraries. NeXT, for instance, originally shipped a somewhat different set of classes than Stepstone, even though NeXT licensed Objective-C technology from Stepstone and initially used a root class named 'Object' and overall very similar to Stepstone's. The 'Swarm' project has its own class library. The OpenStep specification, co-developed by NeXT and Sun, introduced a separate class hierarchy which can be used together with other classes. Indeed, there is specifically no 'show-stopper' as David Stes is claiming: Classes derived from Stepstone's Object class and from NeXT/Sun/Apple's NSObject class can be used together in the same application - among other reasons precisely because Objective-C explicitly allows and caters for the use of multiple different root classes. The end result is that, regardless all of David Stes claims of POC's superiority, POC cannot be used to compile modern Objective-C code such as you would use when developing code using Apple's Cocoa classes on and for Mac OS X, because POC basically implements an old, obsolete dialect of Objective-C (coupled with a few proprietary, incompatible extensions of its own), and its author - David Stes - appears to have no interest in updating POC to be a modern Objective-C compiler. Best wishes, // Christian Brunschen |
|
|||
|
going in a tangent here but,
What are the posibilities of using the closest thing as 'standard Objective-C' in case i wanted to develop for multiple platform like Linux, Windows and Mac ( commnad line apps ) ? thanks for iluminating my dark ignorance. |
|
|||
|
In article <1127938075.204282.131050@g43g2000cwa.googlegroups .com>,
lrojas <luis.r.rojas@gmail.com> wrote: >going in a tangent here but, > >What are the posibilities of using the closest thing as 'standard >Objective-C' in case i wanted to develop for multiple platform like >Linux, Windows and Mac ( commnad line apps ) ? The de-facto standard Objective-C class library is Foundation, as offered in Apple's Cocoa on Mac OS X, and in GNUStep for Linux (and other Unixen) and Windows. If you want to write command-line applications in Objective-C, to work on Mac OS X, Linux and Windows, you should use the latest gcc compiler, and a suitable Foundation library: Either Cocoa or GNUStep on Mac OS X, and GNUStep on Linux and Windows. GNUStep can be doanloaded from <http://www.gnustep.org/> . >thanks for iluminating my dark ignorance. You're more than welcome, // Christian Brunschen |
|
|||
|
Christian Brunschen <cb@df.lth.se> wrote:
> In article <1127938075.204282.131050@g43g2000cwa.googlegroups .com>, > lrojas <luis.r.rojas@gmail.com> wrote: >>going in a tangent here but, >> >>What are the posibilities of using the closest thing as 'standard >>Objective-C' in case i wanted to develop for multiple platform like >>Linux, Windows and Mac ( commnad line apps ) ? > > The de-facto standard Objective-C class library is Foundation, as offered > in Apple's Cocoa on Mac OS X, and in GNUStep for Linux (and other Unixen) > and Windows. > > If you want to write command-line applications in Objective-C, to work on > Mac OS X, Linux and Windows, you should use the latest gcc compiler, and a > suitable Foundation library: Either Cocoa or GNUStep on Mac OS X, and > GNUStep on Linux and Windows. Note that if GNUStep doesn't suit your needs, there are also two libFoundation projects that may work out. The first one hasn't been updated in a long time but is (as far as I know, I haven't used it) fairly complete, and can be found here: <http://sourceforge.net/projects/libfoundation> The second one is part of OpenDarwin and is not ready for production use, but it looks promising, and if you have free time and don't know what to do with it, they could use your help. It can be found here: <http://libfoundation.opendarwin.org/> -- Michael Ash Rogue Amoeba Software |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: converting numeric values to character | toby dunn | Newsgroup comp.soft-sys.sas | 1 | 12-14-2006 05:30 AM |
| Re: Converting from SAS 5 to SAS 9 | Michael L. Davis | Newsgroup comp.soft-sys.sas | 0 | 12-17-2004 10:59 PM |