Show HN: C-ocoa, Write iOS/macOS apps in any language, with a generated C API

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • 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...).

  • 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++.

  • 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...).

  • 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.

    WorkOS logo
  • windy

    Windowing library for Nim using OS native APIs.

  • 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...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts