Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > ObJ

ObJ
Thread Tools
Senior User
Join Date: Feb 2001
Location: Rochester, uk
Status: Offline
Reply With Quote
Mar 20, 2001, 03:21 AM
 
Ok, this is entirely theoretical, but how possible would it be to compile Objective-C to Java Bytecode. (if this isn't entirely theoretical, let me know!)

The problem as I see it, isn't the Objective stuff, which is largely a new syntax for the classes Java already has. There may be slight glitches with Categories, but not insoluble ones.

The problem is C, which wasn't designed for compiling to a pointerless language. For example, you get lines like:

while (*src) *dst++ = *src++;

So we'd have to create a new language (Objective-J?) which overlays the Objective code onto a different base. Ideas, people?

All words are lies. Including these ones.
     
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Mar 20, 2001, 07:48 AM
 
Objective C doesn't really match up with Java at all. I mean is there anything in Java that'd correspond to IMPS or selectors in Objective C? I think trying to compile them to the same thing is like trying to change an apple to an orange.
     
sadie  (op)
Senior User
Join Date: Feb 2001
Location: Rochester, uk
Status: Offline
Reply With Quote
Mar 20, 2001, 09:19 AM
 
How about a new language with ObjC-like syntax and semantics?

The syntax isn't a problem, it's just how to implement various bits of semantics. For example, it does have the ability to build classes on the fly, which you could use for Categories. It does have reflection, which you could use to create something that behaved like Selectors. And ok, you've got me - what's IMPS?

I'm just thinking that something that feels like Objective-C but is cross platform could make porting OS X programs across multiple platforms easier in the future.



[This message has been edited by sadie (edited 03-20-2001).]
All words are lies. Including these ones.
     
Forum Regular
Join Date: Oct 2000
Location: Portland, OR USA
Status: Offline
Reply With Quote
Mar 20, 2001, 12:26 PM
 
With the upcoming release of gcc (3.0 I think) you should be able to compile any supported language to java byte code, as well as compiling Java to native.
     
sadie  (op)
Senior User
Join Date: Feb 2001
Location: Rochester, uk
Status: Offline
Reply With Quote
Mar 20, 2001, 02:40 PM
 
LordJavac claimed:
With the upcoming release of gcc (3.0 I think) you should be able to compile any supported language to java byte code, as well as compiling Java to native.
Er, how? As pointed out, they don't exactly mix. How could gcc compile ANY language to it?

All words are lies. Including these ones.
     
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Mar 20, 2001, 05:41 PM
 
The key part of what LordJavac said was: any supported language to java byte code, as well as compiling Java to native.

However, I think some emphasis should've been put on *supported* in there. I don't see how ANY language would work. It would be too much work to get any(/every)thing compiling into Java bytecode and/or back.

Anyway, is there more info on this? Sounds like it would be pretty cool.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:44 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2