Rust + [Obj-C]
Objective-C in Rust
See objc2 for top-level documentation, including the documentation on framework crates.
Also check out block2 and dispatch2.
Always feel free to open an issue on GitHub if you find a problem or have any questions.
If you prefer to have a more synchronous and less "formal" discussion, there is a Matrix workspace, feel free to ask any questions in the "Users" room.
Also see CONTRIBUTING.md if you would like to help out.
The licensing of the project is a bit complicated, see
LICENSE.md for details.
This repository is a merge of the following projects, see reasoning for the fork here:
objc, renamed toobjc2.objc-encode, renamed toobjc2-encode.objc_exception, moved toobjc2::exception.objc_id, moved toobjc2::rc.objc-foundation, renamed toobjc2-foundation.block, renamed toblock2.
These were created almost solely by @SSheldon, so a huge thanks for their fantastic work on these crates!
Additionally, the dispatch2 crate originally lived here.
This project also draws inspiration from:
apple-syscacao- the
core-foundation-rsproject fruitymetalobjrsobjrand familyrust-maciosuikit-sysand@simlay's Objective-C work onbindgencidre- the
apple-mediaproject dispatch
Finally, this is by far not the only project that ever tried to interoperate with Objective-C; other languages have done so as well (to varying degrees of success):
- Swift: Built from the beginning for Objective-C interop, and is what
objc2aspires to have feature-parity with (though will probably never reach). Truly beautifully designed language! - C#: Xamarin, Xamarin.Mac, a good source of inspiration for what "should" work.
- Python: PyObjC (previously?) official Apple project that worked with "BridgeSupport", nowadays they also generate metadata by invoking Clang. Others include
objpand rubicon.objc - Ruby: MacRuby, RubyCocoa
- Dart:
ffigen - Kotlin: somewhat built-in support
- Nim: somewhat built-in support,
darwin,objc - D: somewhat built-in support,
derelict - Java: Java-Objective-C-Bridge, Multi-OS Engine: Nat/J (also has a generator), Apple also has a very old official project.
- Node.js: NodObjC,
objc - Zig: zig-objcrt
- V: Not really existing, they just write and compile Objective-C code, and use manual C-bindings.
- Go: MacDriver