Open
Description
I've been quite focused on this project simply being "improve the safety of Objective-C in Rust", but @silvanshade recently proposed that we try to reach higher than just that, instead try going for "something that is (at least somewhat) competitive with Swift" (Swift interop is discussed in #524).
This required a bit of a mental shift for me, but ultimately, I think it is the right way to go about it. This change in mindset should help me realize that tooling, e.g. good rust-analyzer
and debugger support, is really important, and we should spend effort on that not just in this project, but also in requesting changes to Rust to make it possible.
A few subtasks:
- Make ownership much simpler in the common case: Redo how ownership works #419
- Some way to allow defining your own Objective-C interfaces, see e.g. Merge
header-translator
intobindgen
#729. - All of Class definition improvements #428
- Better error/exception "user info" access (see discussion in Fix enums and typedefs in framework crates #310)
- Better main thread support #496
- Investigate and push forward Rust features that:
- Add keyword-like parameters (framework functions are very long and ugly)
- Improves library debugger support
- Improves the ergonomics of using smart pointers
Allocated
andId
- Some way to better declare categories - for example allows us to represent them as a trait, possibly as "inherent traits?"
- Some way for the compiler to automatically convert
Id<NSButton>
toId<NSView>
, since callingId::into_super
(potentially many times) is quite cumbersome. Maybe the coerce unsized feature will do it for us? - Some kind of
#[distributed_slice]
, as suggested by epage in their blog post about testing would be really nice for makingdeclare_class!
cleaner.- Linking Zulip stream about this
- Linking Zulip stream about
linkme
- Linking an older Zulip discussion about similar things
- Note for future RFC: These
static
s would work similar toextern
statics, in that you can't performconst
operations on them. - Linking
#[distributed_slice]
aka a method to enumerate tests rust-lang/testing-devex-team#3. - Linking https://internals.rust-lang.org/t/global-registration-a-kind-of-pre-rfc/20813.
- Improve our ability to name functions directly, meaning that we can associate e.g. a
Sel
with each function, very similar to what Swift does. - Make examples easier to run
- Make
MainThreadMarker
,AutoReleasePool<'p>
and availability easier to use (contexts & capabilities) - The ability to declare custom attributes as unsafe.
- Allowing inherent associated types, just like Swift does.
- Make it easier to link Rust-built static libraries with the system linker.
- More ergonomic reference-counting, Simplify lightweight clones, including into closures and async blocks rust-lang/rfcs#3680.
- Improving backtraces of
msg_send!
/msg_send_id!
/extern_methods
. - Improving macro expansion in
extern_methods
such that error spans point to the definition of the method, instead of the macro invocation itself. - Better
const
support to allow us to do Create blocks with BLOCK_HAS_SIGNATURE #442 without the user needing to write out the type themselves.
- Integrate
header-translator
work intobindgen
. - Add
objc2
support incbindgen
. - ...