{"id":31642,"date":"2021-02-11T21:50:53","date_gmt":"2021-02-12T02:50:53","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=31642"},"modified":"2021-02-11T21:50:53","modified_gmt":"2021-02-12T02:50:53","slug":"native-mac-apis-for-go","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2021\/02\/11\/native-mac-apis-for-go\/","title":{"rendered":"Native Mac APIs for Go"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/progrium\/macdriver\">MacDriver<\/a> (via <a href=\"https:\/\/news.ycombinator.com\/item?id=26026896\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/github.com\/progrium\/macdriver\"><p>MacDriver is a toolkit for working with Apple\/Mac APIs and frameworks in Go. It currently has 3 &ldquo;layers&rdquo;:<\/p><p>[&#8230;]<\/p><p>The <code>objc<\/code> package wraps the <a href=\"https:\/\/developer.apple.com\/documentation\/objectivec\/objective-c_runtime?language=objc\">Objective-C runtime<\/a> to dynamically interact with Objective-C objects and classes[&#8230;]<\/p><p>[&#8230;]<\/p><p>The <code>cocoa<\/code>, <code>webkit<\/code>, and <code>core<\/code> packages wrap <code>objc<\/code> with wrapper types for parts of the Apple\/Mac APIs. They&rsquo;re being added to as needed by hand until\nwe can automate this process with schema data. These packages effectively let you use Apple APIs as if they were native Go libraries, letting\nyou write Mac applications (potentially also iOS, watchOS, etc) as Go applications[&#8230;]<\/p><p>[&#8230;]<\/p><p>The <code>bridge<\/code> package takes advantage of this situation to create a higher-level abstraction more aligned with a potential\ncross-platform toolkit.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>MacDriver (via Hacker News): MacDriver is a toolkit for working with Apple\/Mac APIs and frameworks in Go. It currently has 3 &ldquo;layers&rdquo;:[&#8230;]The objc package wraps the Objective-C runtime to dynamically interact with Objective-C objects and classes[&#8230;][&#8230;]The cocoa, webkit, and core packages wrap objc with wrapper types for parts of the Apple\/Mac APIs. They&rsquo;re being added [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2021-02-12T02:50:56Z","apple_news_api_id":"0f77b5aa-5384-4649-b77e-651b4b0084c8","apple_news_api_modified_at":"2021-02-12T02:50:56Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AD3e1qlOERkm3fmUbSwCEyA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[846,30,1891,71],"class_list":["post-31642","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-go-language","tag-mac","tag-macos-11-0","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31642","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=31642"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31642\/revisions"}],"predecessor-version":[{"id":31643,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/31642\/revisions\/31643"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=31642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=31642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=31642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}