rust-objc
rust-objc copied to clipboard
Plan for higher-level bindings?
By "high level", I mean:
- Fewer places in user code where
unsafe
is necessary. - Improved ergonomics, e.g. seamless conversion between basic types, block <-> closure, exception <->
Result
.
Do you think they belong to this crate? Or maybe it's the job of bindgen and the layers above?
I also found several related efforts:
- objrs.
- RustKit (referenced by core-foundation-rs).
- bindgen's objc support, which uses this crate.
How do you think their approaches compare to this? Can we combine the efforts somehow?
Fewer places in user code where
unsafe
is necessary.
Improved ergonomics, e.g. seamless conversion between basic types
msg_send!
and such cannot be made safe, because we cannot verify that the selector's arguments are correct.
But other crates like objc-foundation
goes some of the way of implementing safe abstractions on Foundation
types (fruity
also deserves a mention here).
block <-> closure
block
exists and can currently safely provide the closure -> block
part, and maybe in the future block -> closure
.
exception <->
Result
There exists objc_exception
, but it actually causes UB until the ffi-unwind project group progresses further.
Can we combine the efforts somehow
-
objrs
takes a completely different approach (we use the dynamic API, they declaratively / statically create classes), but the ideas might get integrated into this project at some point when they're more stable. - I think
RustKit
is dead? -
bindgen
might be a viable approach for some of the ergonomics, hadn't considered that before, thanks for the link!