Apple open sources Swift Playground Support

Kate Stone writes on the Swift.org blog:

We are delighted to introduce Xcode Playground Support as part of the Swift open source community!

Swift developers can approach the language in many different ways. In addition to the traditional command-line compiler and interactive REPL one of the earliest experiences for many developers was through the introduction of playgrounds in Xcode. Prior to Swift 3.0 and Xcode 8 this was only possible with the version of Swift included with Xcode. The Xcode Playground Support project enables building a Swift toolchain that includes everything necessary to integrate with the Xcode 8 playground experience. Playground Support will be included in corresponding snapshots. Download a snapshot, install it, and select the toolchain to work with the latest Swift features in Xcode playgrounds.

The Playground Support source code can be found here (thanks, Jordan!) So far, my very favorite bit comes from Woodchuck.swift, part of the PlaygroundLogger module:

//
//  Woodchuck.swift
//  PlaygroundLogger
//
//  Copyright (c) 2014-2016 Apple Inc. All rights reserved.
//

// “How much logging could a PlaygroundLogger log if a PlaygroundLogger could log logs"

Admittedly there’s not a lot of “there” there, but it’s still great to see what’s available.

Comments are closed.