Skip to content

Instantly share code, notes, and snippets.

View jaekong's full-sized avatar

Jae Kong jaekong

View GitHub Profile
@lattner
lattner / async_swift_proposal.md
Last active October 29, 2024 18:53 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@gregcotten
gregcotten / CVPixelFormat Descriptions
Created August 29, 2019 18:45
All Public and Private CVPixelFormat Descriptions
Structure is [PixelFormatTitle: DescriptionDictionary]. PixelFormatTitle is the kCVPixelFormatType_ suffix (if known) and the FourCharCode as a string or int if the string is too short.
[["32ARGB / 32": {
BitsPerBlock = 32;
BitsPerComponent = 8;
BlackBlock = <ff000000>;
CGBitmapContextCompatibility = 1;
CGBitmapInfo = 16388;
CGImageCompatibility = 1;
ContainsAlpha = 1;