KrakenKit icon indicating copy to clipboard operation
KrakenKit copied to clipboard

C and C++ port

Open H2CO3 opened this issue 11 years ago • 8 comments

Hi, I think a C and a C++ API wrapper (better yet, a complete rewrite) would be useful. I'd be happy to collaborate.

H2CO3 avatar Jun 12 '13 15:06 H2CO3

I'd say complete rewrite. That means quite a lot has to be gutted. Do you know of a stable alternative to:

  • [ ] AFNetworking
  • [ ] Mantle (we can write our own, but still).
  • [ ] Unit Testing (again, not necessary with XCTest, but still would be nice to replace Specta/Expecta)

CodaFi avatar Jun 12 '13 15:06 CodaFi

I'd also like to have as little work to do as possible on the foundation types (especially containers), so it should be in C++

CodaFi avatar Jun 12 '13 15:06 CodaFi

Well, I think I'll be able to make a C and a C++ wrapper as well. As for the alternative libraries: AFNetworking can be replaced by libcurl, Mantle in C++ is essntially Boost. Unit testing is a different question, I'll see the options.

H2CO3 avatar Jun 13 '13 05:06 H2CO3

Alright. I've reorganized the project's structure to make it easier to write a C and C++ API with an Objective-C overlay. Give me a second to make you a collaborator.

CodaFi avatar Jun 13 '13 18:06 CodaFi

Done! Any thoughts on an API structure? I was thinking about remaking NSOperation with pthreads or std::threads. I think boost might be too big of a dependency, seeing as all we'd really need is libJSON and to have every class expose a static map of keys to function pointers

CodaFi avatar Jun 13 '13 18:06 CodaFi

Well, I haven't yet looked into the API structure too deeply, but I have written a JSON parser for C (libjsonz). I'd be more than happy to drop Boost as a dependency as well.

H2CO3 avatar Jun 13 '13 21:06 H2CO3

Sounds good. If you'd like to add it as a submodule, be my guest. Probably put it in src/External/

CodaFi avatar Jun 13 '13 22:06 CodaFi

Added libjsonz as a submodule under src/extern, and created directories src/c and src/cpp.

H2CO3 avatar Jun 14 '13 18:06 H2CO3