Re: Fresh Ground Up Objective-C Port

103 views
Skip to first unread message

Steven Parkes

unread,
Jun 11, 2012, 10:49:27 PM6/11/12
to thecarpenter, zx...@googlegroups.com
> Not sure who is currently maintaining/developing the objective-c/iphone port

There is no pure Objective C port at this point. There are two Objective C interfaces based on the core C++ port: one in the iphone directory and one in the objc directory. The iphone directory is really an iOS UIKit interface. It provides a UIViewController and some fixed UIViews. The objc directory is compatible with both OS X AppKit and iOS UIKit. It provides an interface at the CA CALayer level. There is duplication between the two; the objc directory is something of a refactoring of the iphone stuff, both to support AppKit and to provide a more flexible interface than the widget in the iphone directory. The iphone directory code has not been factored to use the objc code (but it could be …)

Porting everything to Objective C sounds like a lot of work. The only advantage I could see is that it avoids C++ if you don't want to use C++. Otherwise, seems like it'd be far easier to port the pdf417 decoder from Java to C++, both because the languages are more similar and because much of the shared code has already been ported.

thecarpenter

unread,
Jun 12, 2012, 1:11:56 AM6/12/12
to zx...@googlegroups.com, thecarpenter

Sound reasoning on sticking with the C++ base - and I assume it would be more helpful to other ports(?).  I saw a patch that was provided for the pdf417 decoding that was noted on another thread, any comment on the quality/usability of that code or is it worth starting a fresh port of the java base in a new branch?  Lastly, is there a post or details somewhere on branching and merging/patching policy for the project as a whole?

Costa Walcott

unread,
Jun 14, 2012, 11:24:51 PM6/14/12
to zx...@googlegroups.com
Actually, I've been working on an Objective-C port just as you describe:


It could probably use a little more bug testing, but it's a full, direct port of ZXing.
-Costa

On Sunday, June 10, 2012 9:13:40 PM UTC-7, thecarpenter wrote:
Hey Guys, 

I am thinking of starting a fresh objective-c port of the java base ... a full ground up solely objective-c rebuild.  Not sure who is currently maintaining/developing the objective-c/iphone port - if someone is please let me know how I can help.  I am mainly interested in parsing pdf417 barcodes, so know that I have ulterior motives ;-)

Thanks,
Bill

Sean Owen

unread,
Jun 15, 2012, 5:00:17 AM6/15/12
to zx...@googlegroups.com
Costa you and/or anyone else is welcome to develop within the zxing repository. It would be nice to keep it all under one roof -- or at least to have a snapshot here.

Or if it's just much easier to work separately, and interested parties want to collaborate there, I don't even mind deleting the ObjC port here and pointing to an external one as the 'most official' maintained port.

Steven Parkes

unread,
Jun 15, 2012, 10:03:54 AM6/15/12
to zx...@googlegroups.com
On Friday, June 15, 2012 2:00:17 AM UTC-7, Sean Owen wrote:
 
I don't even mind deleting the ObjC port here and pointing to an external one as the 'most official' maintained port.

I would prefer it if you wouldn't offer to delete code I wrote, maintain, and use without some discussion. 

Steven Parkes

unread,
Jun 15, 2012, 10:05:42 AM6/15/12
to zx...@googlegroups.com
On Thursday, June 14, 2012 8:24:51 PM UTC-7, Costa Walcott wrote:
Actually, I've been working on an Objective-C port just as you describe:


It could probably use a little more bug testing, but it's a full, direct port of ZXing.
-Costa

Would be better from my perspective if you didn't use identical class names to existing code. I already can't tell what code people are talking about.

Maybe use ZXO instead of ZX.

Steven Parkes

unread,
Jun 15, 2012, 10:18:48 AM6/15/12
to zx...@googlegroups.com


On Thursday, June 14, 2012 8:24:51 PM UTC-7, Costa Walcott wrote:
Actually, I've been working on an Objective-C port just as you describe:


It could probably use a little more bug testing, but it's a full, direct port of ZXing.
-Costa

Have you run the blackbox tests against this objective c core?

We'll have to decide as a project how we want to handle this. I'm personally not interested in (but not against) an Objective C core. I use the C++ code in non-osx/ios contexts so it's where I put my effort.

Steven Parkes

unread,
Jun 15, 2012, 1:31:51 PM6/15/12
to zx...@googlegroups.com


On Thursday, June 14, 2012 8:24:51 PM UTC-7, Costa Walcott wrote:
Actually, I've been working on an Objective-C port just as you describe:


FWIW, I don't object to a native Objective C port. I wish there was a way to not fragment efforts, since maintaining a port takes a fair amount of effort and we're short of that as it is. But if someone wants to use Objective C instead of C++, I don't see any way around that.

It looks like you've used some of the code from the objc directory. To the extent that we could make these not conflict, I'd appreciate that.

There are two classes of classes here:

The Objective C analogs of the Java classes, e.g., HybridBinarizer
The Cocoa/Cocoa Touch classes, e.g., ZXCapture

For the second case, it'd be nice if we could have just one copy of these classes so everybody benefits from improvements.

For the first case, if were possible to use the same external API independent of the implementation it'd make the previous point easier (or maybe even feasible). If we can't make the API's identical, as I said, I'd appreciate you using different class names.


Daniel Switkin

unread,
Jun 15, 2012, 2:09:55 PM6/15/12
to Steven Parkes, zx...@googlegroups.com, co...@thelevelup.com
Without understanding all of the details, my gut feeling is it would be better to focus our energy on the Java and C++ versions and maintain just an Objective C wrapper. Steven has done a huge amount of work keeping the C++ port up to date and it just goes to show how hard adding another major language would be, for not much benefit. Isn't it pretty common to call C++ code for number crunching from ObjC UI code in Apple software anyway?

Romain Pechayre

unread,
Jun 15, 2012, 2:20:34 PM6/15/12
to Daniel Switkin, Steven Parkes, zx...@googlegroups.com, co...@thelevelup.com
+1. I don't really see the point by making an objc port since cpp port is fully compatible with objc. And as a programming language cpp is far more performant than Objective-C.

Regards

-- 
Romain Pechayre
Sent with Sparrow

Sean Owen

unread,
Jun 15, 2012, 2:44:41 PM6/15/12
to zx...@googlegroups.com, Steven Parkes, co...@thelevelup.com
(I should probably stop commenting on things I don't understand... definitely keen to follow the lead of those who know better. If core lib C++ is indeed reusable let's keep it that way within the project.

Steven Parkes

unread,
Jun 15, 2012, 6:48:54 PM6/15/12
to Daniel Switkin, zx...@googlegroups.com, co...@thelevelup.com
On Jun 15, 2012, at 11:09 AM, Daniel Switkin wrote:

> Isn't it pretty common to call C++ code for number crunching from ObjC UI code in Apple software anyway?

Apple uses both Objective C and C++ extensively. The Objective C code is not limited to UI but C++ is definitely "first class" to them. Many of the "core" frameworks, e.g., core graphics, core text, are C APIs (Apple doesn't use C++ APIs) but are implemented in C++. Even many of the Objective C frameworks have substantial code written in C++ (as can be seen by looking at stack traces in the debugger).

Costa Walcott

unread,
Jun 17, 2012, 8:55:29 PM6/17/12
to zx...@googlegroups.com
The reason I started the project was because I was looking to generate barcodes, which the C++ port doesn't support. My C++ skills are pretty rusty, which is why I went with the Objective-C port. But I can certainly the benefit of a full C++ port. Hopefully my port will help people be able to use ZXing on iOS and Mac apps until the C++ port is completed. Also, the blackbox tests have also been ported, with virtually the same passing counts as Java.

ryanmc

unread,
Jun 18, 2012, 5:16:27 PM6/18/12
to zx...@googlegroups.com
Is your project in the Market? I have a website that uses the barcode scanner, but I have been unable to deploy it to iOS because their has not been a iOS 1D barcode scanner in the market that supports scanning from webpages (I am hoping that if you did a full port that you also support scanning from webpages?).

Steven Parkes

unread,
Jun 18, 2012, 5:20:18 PM6/18/12
to Costa Walcott, zx...@googlegroups.com
> Also, the blackbox tests have also been ported, with virtually the same passing counts as Java.

It was an automatic port with customization, if I recall?

Sounds like a lot of good effort. I wish we could do something similar for some of the C++ code.
Reply all
Reply to author
Forward
0 new messages