BT

Quickly Create Mono Bindings with Objective Sharpie

| by Jonathan Allen on May 10, 2013. Estimated reading time: 1 minute |

Objective Sharpie is the child of Aaron Bockover. This tool creates C# bindings suitable for use in Mono for Objective C SDKs.

Objective Sharpie works by using Clang to parse Objective C header files. Since the process is automated, and has full access to the header, binding errors should be non-existent for most libraries.

Aaron created Objective Sharpie in order to deal with the tedious task of creating bindings for OS X Lion and Mountain Lion. According to Aaron, OS X Lion “thousands of new APIs”. He continues,

This fear of monotony fueled me to implement a tool that used Clang as a library to gain access to every single detail of the source tree as it’s parsed. With this information, I was able to start generating C# code that represented a verifiably correct binding.

It’s important to note that we build Xamarin.Mac and Xamarin.iOS using the exact same binding tools that are available in Xamarin Studio to bind third party libraries. And now Objective Sharpie is no different: it helps us deliver faster on new APIs and ensure that they are accurate and error-free by producing a correct binding definition up front.

It is important to note that this is a work in progress. While most common language features are covered, the code generator doesn’t support the entire Objective C language. It also doesn’t correct naming conventions, so you may wish to do that manually.

Rate this Article

Relevance
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss
BT