100% on board, don’t even need to ask me twice. :)
I’ve been meaning to return to this and release 0.3 from the new branch anyway, so I could tie this into that.
Thanks for trying to make this stuff better! I’d thought about trying something similar about a year ago but couldn’t justify it in my list of things to do. :(
On Sat, Jun 25, 2022 at 15:57, Mads Marquart @.***> wrote:
Hey, macOS maintainer of winit here. I've been working on a replacement for objc called objc2, and I think it could be interesting for this crate?
Some of the concrete improvements you'd reap benefit from, mainly in the category "improving correctness":
- Helper macro msg_send_id! for following cocoa's memory management rules - as a quick example, NSString::new currently leaks because it uses Id::from_ptr instead of Id::from_retained_ptr.
- Implementing Encode is now required for all types that go across msg_send! - this is great for catching bugs, for example this code in ListView::select_row_indexes is wrong, the type of index is &usize while it should be usize.
- Soundness fixes concerning message sending, autoreleasepools and reference counting.
I have an implementation of Foundation that you may be interested in using, at the very least it can be useful as an example of how to use objc2 well.
See also my PR to the core-foundation-rs project.
Opening this issue to start the discussion, am a bit tired so sorry it's not more detailed. I would really like to work towards a completely safe interface over (the most commonly used parts of) Cocoa, but wanted to keep it out of the scope of objc2 itself - cacao seems like a nice work in that direction, would like to help out in this effort (other than just working on objc2).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: @.***> on Replace objc
with objc2
?
4 days ago