objc2 icon indicating copy to clipboard operation
objc2 copied to clipboard

WIP on desired `bindgen` output

Open madsmtm opened this issue 2 years ago • 1 comments

Progress on evaluating if and/or how we should do #85.

Don't look too much at the objc2-foundation-sys stuff, the idea is that that part would be automatically generated - rather, focus on objc2-foundation, and think about whether using the bindings is better or worse.

madsmtm avatar Dec 21 '21 02:12 madsmtm

Another random idea: Add a new macro that makes it possible to still use the "familiar" msg_send! syntax:

msg_send_2![self, getObjects: vec.as_ptr(), range: range]
// ->
self.getObjects_range_(vec.as_ptr(), range)

This would require the paste macro.

madsmtm avatar Dec 21 '21 02:12 madsmtm

The biggest problem I had with this approach was that the separation between a sys crate and a "Rusty" crate lead to a lot of unnecessary duplication - and you're effectively always going to just be using the sys crate since we can't possibly hope to make "Rusty" bindings for all of Foundation/AppKit.

Future work in this problem space is happening in https://github.com/madsmtm/objc2/pull/264

madsmtm avatar Nov 03 '22 22:11 madsmtm