Our great sponsors
-
metal-cpp
Metal-cpp is a low-overhead C++ interface for Metal that helps developers add Metal functionality to graphics apps, games, and game engines that are written in C++.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
This is basically also what the "official" C++ API for Metal does (https://developer.apple.com/metal/cpp/), it's an automatically generated bindings wrapper which calls into ObjC runtime functions.
I also dabbled a bit with this idea by parsing clang AST-dumps of macOS system headers:
https://github.com/floooh/objc-ast-experiments
Unfortunately this is very brittle, and also broke on ARM CPUs, I guess the shim code needs some ABI adjustments (famously, objc_msgSend has multiple "ABI shapes": https://www.mikeash.com/pyblog/objc_msgsends-new-prototype.h...).
This is basically also what the "official" C++ API for Metal does (https://developer.apple.com/metal/cpp/), it's an automatically generated bindings wrapper which calls into ObjC runtime functions.
I also dabbled a bit with this idea by parsing clang AST-dumps of macOS system headers:
https://github.com/floooh/objc-ast-experiments
Unfortunately this is very brittle, and also broke on ARM CPUs, I guess the shim code needs some ABI adjustments (famously, objc_msgSend has multiple "ABI shapes": https://www.mikeash.com/pyblog/objc_msgsends-new-prototype.h...).
Interesting project, though I'd rather just use Obj-C. I guess if you wanna use it in something like JavaScript or Lua it'd make sense to have C as a bindi g layer.
> https://gamepipeline.org/betray.html
Interesting, I've been using a similar project for Nim lately: https://github.com/treeform/windy
It's surprising how simple Obj-C interaction is compared to Java JNI or something. Here's the Obj-C interop for Windy:
- macdefs: https://github.com/treeform/windy/blob/master/src/windy/plat...