Hacker GitHub

← All repos

garettbass/oc

View on GitHub ↗ ★ 63 C

Macro magic for declaring/calling Objective-C APIs from C11 or C++. Preloads selectors, chooses the correct objc_msgSend to call per method/platform.

3 mentions on Hacker News by 1 person: 0 stories, 3 comments · first 2021-12-12 · latest 2025-04-18

Mentions per year 3 mentions · busiest year 2021 (1)
20082026
  1. Yes, technically it's possible by wrapping the ObjC runtime API, see solutions like these: - https://github.com/garettbass/oc - https://github.com/mitchellh/zig-objc Whether that's better than writing ObjC directly is another question,…
  2. Here's something similar by Garrett Bass: https://github.com/garettbass/oc ...I also experimented a bit with parsing macOS system headers via clang-ast-dump and then code-generating C and Zig bindings but that didn't get far:…
    comment by flohofwoe · 2024-04-19 · in C-Macs – a pure C macOS application
  3. …by going directly through the Objective-C runtime API, but this requires either macro magic (like: https://github.com/garettbass/oc/ ), or code-generated headers (which was most likely used in the official Metal-cpp wrapper:…