taffy icon indicating copy to clipboard operation
taffy copied to clipboard

C bindings

Open nicoburns opened this issue 2 years ago • 3 comments

What problem does this solve or what need does it fill?

The ability to use Taffy from languages other than Rust.

What solution would you like?

Official C bindings maintained in the Taffy repository.

Additional context

  • Most languages have facilities to bind to C libraries, so a C API not only allows Taffy to be used from C/C++/Objective-C, but makes it much easier for people to create bindings to other languages that don't (yet) have their own bindings.

Prior Art

  • Yoga's C API (https://github.com/facebook/yoga/blob/48d82224ee34fd60ad21ab90a2c38dd4cfb1fdb4/docs/_docs/api/c.md)

  • Stretch's C bindings (https://github.com/vislyhq/stretch/blob/master/bindings/swift/StretchCore/src/lib.rs)

  • Taffy C bindings created for NativeScript-Mason (https://github.com/triniwiz/nativescript-mason/tree/main/packages/nativescript-masonkit/src-native)

nicoburns avatar Mar 20 '23 14:03 nicoburns

+1'ing this. Currently using Yoga but would like another option that is more capable of being compiled to a DLL and bound via a C ABI. My target is C#/.NET but as you pointed out there are a world of additional use cases that this would unlock.

kkukshtel avatar Sep 14 '23 16:09 kkukshtel

I don't have the expertise to maintain this, but I think this is a thing that should exist. If you'd like to help maintain these, please let us know in this thread!

alice-i-cecile avatar Sep 14 '23 17:09 alice-i-cecile

Is there any movement on this? Would be great!

crystalthoughts avatar Dec 18 '23 11:12 crystalthoughts