-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plans for collaboration with objc2
?
#2
Comments
I didn't reply bc I'm thinking how we could collaborate and how can I use objc2.
This is first part, just sharing... |
Yeah, I recognize all of these, which is why I wrote While the latter may be useful to you internally, to verify that the types you've written are correct, and while it has the possibilty of doing some of the things you've named here in the future (name translation, C framework support, more Rusty), this proposal was mostly about using just Thanks for your thoughts, they are good points for how I could improve |
Closing this issue. Feel free to reopen if needed. |
Hey @yury, we talked a bit about about this over email, but I wanted to elaborate in full.
I think it would be beneficial for our two projects to collaborate, since we're both defining API(s) over Apple's frameworks - especially our abstractions over the Objective-C runtime would benefit from collaboration.
Concretely, I think a shared codebase for this is the way to go.
I believe the best way forward here would be for
cidre
to build uponobjc2
, sinceobjc2
was built with the idea of it being a library that others can use like this - but if you think it would make more sense to make some kind ofobjc-core
crate, I would be fine with that as well. In general, just sharing ideas and discussing things should also provide a great benefit to both of us, so please treat this proposal ofcidre
moving toobjc2
as just that; a proposal ;).Looking at your stated goals, I think the bits about performance is fully compatible with mine, I very much want to make it possible to have fast, zero-cost interaction with Objective-C! Your other goals, i.e. Rusty API / ML friendly, can still be pursued by this crate while using
objc2
.Although
objc2
tries to support older platforms, your explicit goal of not doing so is not incompatible with it; I would be completely on-board with adding a feature flag to enable newer features that would yield higher performance (in fact, I am working on functionality to do this based on the deployment target, so the user wouldn't even have to do anything).With that out of the way, let me try to outline the pros and cons of
cidre
moving toobjc2
:Pros
objc2
.objc2
being "the ecosystem", of course).cidre
would benefit as well).Cons
Since
Allocated<T>
is a struct in a different crate, you can't implementinit
methods for this the same way you're currently doing it. Specifically, you would either have to providenew
methods that does the allocation internally, or live with having to doData::init_with_bytes(Data::alloc(), bytes)
in the interrim.Note that arbitary self types are somewhat nearing stabilization, which would solve this issue completely.
objc2::rc::Id
(the equivalent tocidre::arc::Retained
) does not allow overriding theretain
/release
implementations, so CoreFoundation may be a bit harder for you to support.I am still not sure of the best approach here, so very willing to discuss this part!
The code lives somewhere that you don't control, which will make it harder for you to make changes.
What do I gain?
I'm trying to win you over to using
objc2
because I believe your input, as well as performance improvements you find, would be valuable to the project.After all, the more use-cases
objc2
can satisfy, the more users it has, and the better off the project is!Implicit in the above is that I'd be willing to shape
objc2
to fit your goals, if needed!I hope you don't take offense to this proposal, again, if you disagree with this, I would still like to collaborate!
Feel free to contact me on email or on Element (
@madsmtm:matrix.org
) if you want to discuss things in a private medium/more synchronously.The text was updated successfully, but these errors were encountered: