News for hackers. Stuff that matters.
Re:J2ObjC: A Java to iOS Objective-C translator by Google by Xuzz on Friday September 14, 2012 @04:47AM (#4520789)
Previous submission (still on the front page right now, at least): http://news.ycombinator.com/item?id=4518588
Re:J2ObjC: A Java to iOS Objective-C translator by Google by invalidname on Friday September 14, 2012 @04:47AM (#4520790)
Its a joke. It translates Java to Objective-C code without GC support (uses reference counting which you need to annotate). It doesn't define any UI so effectively you need to work on a Mac just without all the wonderful tools for UI building that apple provides and without any of the WORA you get from Java. When something doesn't work you are still stuck debugging in Objective-C. And googling stack overflow trying to understand how to translate Objective-C code to your problem.

Codename One solves all of the above issues by giving "actual WORA" which is the true value of Java.

Re:J2ObjC: A Java to iOS Objective-C translator by Google by dhconnelly on Friday September 14, 2012 @09:22AM (#4521471)
Well, nearly everything you said about J2ObjC is incorrect.

1. You can use ARC with J2ObjC. Your other comment about it not being supported is incorrect.

2. If you're not using ARC, then no, annotations are not required to get reference counting. The annotations are for "weak references" and are optionally available to avoid cyclic reference problems. They are not used in most cases.

3. You're not stuck without the Apple UI tools; in fact, you are encouraged to use Interface Builder for your UI.

Source: I worked on J2ObjC for Google this summer.

Re:J2ObjC: A Java to iOS Objective-C translator by Google by invalidname on Friday September 14, 2012 @11:34AM (#4522170)
1. ARC isn't a GC. Objective-C on the desktop has a true GC which isn't supported for iOS development. ARC just hides the repetitive pool release calls but still has the cyclic reference problems. 2. Sure. Its still not a GC, its reference counting which is exactly what I said. Its still reference counting even if you don't have to actually write pool release. 3. Again this is EXACTLY what I said! You need to use Apple's UI tools which means you need to code in Xcode!!! Not in Eclipse or any other Java IDE! If you need to deal with xcode and debug Objective-C in xcode might as well write everything in xcode.

If you want to share code with Android then you are better off with C. Yes the dalvik native interfaces suck but that is a tried and true way that actually works.

If you want to write in Java then Codename One is pretty much the only usable option.

Re:J2ObjC: A Java to iOS Objective-C translator by Google by klausa on Friday September 14, 2012 @05:04AM (#4520827)
Isn't GC deprecated in favour of ARC?
Re:J2ObjC: A Java to iOS Objective-C translator by Google by invalidname on Friday September 14, 2012 @07:36AM (#4521118)
Nope. ARC is just slightly better pools but its no GC alternative and won't work with Java code. Java can't be used without a GC so these guys came up with special annotations for reference counting which is very iOS specific. So essentially you write Objective-C code in Java, I fail to see the benefit here? You have to learn objective-c anyway and use all of the toolchains from Apple. So why add an extra step and not go directly to Objective-C? The benefit of a solution like Codename One is clear, it allows you to forgo Apple's tools almost entirely and work exclusively in Java (which I personally prefer to Objective-C).
Re:J2ObjC: A Java to iOS Objective-C translator by Google by overcyn on Friday September 14, 2012 @11:02AM (#4521960)
Yes in mountain lion garbage collection has been deprecated in favor of arc
Re:J2ObjC: A Java to iOS Objective-C translator by Google by stuaxo on Friday September 14, 2012 @05:28AM (#4520879)
What's a WORA?

This is just a good start is all.

Re:J2ObjC: A Java to iOS Objective-C translator by Google by RealCasually on Friday September 14, 2012 @05:31AM (#4520885)
Write Once, Run Anywhere.
Re:J2ObjC: A Java to iOS Objective-C translator by Google by dhconnelly on Friday September 14, 2012 @09:30AM (#4521509)
To save time for those who won't read the wiki:

This is not a tool to convert Java apps to iOS apps. This is a tool that helps you write business logic in one language so it can be shared without duplication between Android, web (via GWT), and iOS apps. Write your presentation logic with the native tools, ie. Interface Builder, etc. Cross-platform mobile UI support is explicitly avoided. Xcode is great--use it!

Re:J2ObjC: A Java to iOS Objective-C translator by Google by RealCasually on Friday September 14, 2012 @05:31AM (#4520887)
This seems a lot like a rebrand of XMLVM (http://xmlvm.org/overview/ -- also a Google-employee-run project) with some missing UI features.
Re:J2ObjC: A Java to iOS Objective-C translator by Google by invalidname on Friday September 14, 2012 @08:46AM (#4521330)
XMLVM is an academic project and not run by google employees.