Announcing nef Playgrounds for iPad 1.0
by Tomás Ruiz López
- •
- May 27, 2020
- •
- swift• functional programming• bow
- |
- 4 minutes to read.

Over the course of the past four weeks, we’ve released new versions of the main Bow ecosystem libraries. We started with Bow 0.8.0, which, among other features, included important work in the area of Comonads. A release of nef 0.6.0 followed, with an important migration towards being 100% Swift, 100% Functional, contributing to an increase in stability and robustness. Then, Bow OpenAPI 0.2.0 emerged, with better support to work on Linux systems, just like the two previous announcements. Finally, last week we released Bow Arch 0.1.0, a library to architect SwiftUI-based applications in a pure functional way, built on top of the idea of Comonadic User Interfaces.
All these announcements have paved the way for the new project that we are announcing today: nef Playgrounds. nef Playgrounds is an iPad app that lets you create Swift Playgrounds with your favorite Swift dependencies in a seamless way. Do you want to know more about it? Keep reading below!
Power-ups for Swift Playgrounds
We love Swift Playgrounds; they let us prototype Swift code easily and without the hassle of creating an entire Xcode project. We can even use them on the iPad, where they are proving to be a fantastic tool to learn coding in Swift. However, they have some limitations.
Since the inception of nef, we have been determined to bring Swift Playgrounds to the next level. We have used them to keep documentation in sync with our code or generate Carbon snippet images. We can even create Swift Playgrounds with 3rd party dependencies for iPad using nef. But, until now, you needed to do it on a Mac, and later load the generated Playground onto your iPad.
nef Playgrounds removes that necessity. It lets you search GitHub for your favorite Swift repositories, select the version or branch you want to use, and generate a Playground that contains the libraries you have selected - all without ever leaving your iPad. You can open the result in the Swift Playgrounds app, and use it right away.
100% Swift, 100% Functional Programming
This project comprises two important parts: an iPad application, and a backend. Both have been written entirely using Swift and Functional Programming.
In the case of the iPad application, its user interface has been written using SwiftUI, and it is powered by Bow and Bow Arch. It uses the GitHub API; we have used Bow OpenAPI in order to generate a network client that interfaces with GitHub to perform searches, and retrieve branches and tags.
Bow OpenAPI also eases the communication with our own backend - which we also wrote in Swift using Vapor 4.0 - and the exchange of authentication information with Apple Sign In services. At the core of our backend, we use nef to fetch the user’s selected dependencies and build the desired Swift Playground Book.
Fully open source
Like the rest of our libraries and projects, both repositories containing the client and the server are Open Source and available in GitHub. They aim to serve as an educational resource for using the libraries in the Bow ecosystem, together with other libraries, such as some iPadOS frameworks, or Lottie, which need to be adapted to the Functional Programming paradigm.
Conclusion
With WWDC 2020 right around the corner, and so many rumors and wishes about an Xcode version for iPad, we hope that nef can, at least, fill a portion of that gap in the meantime. It is a nice companion to Swift Playgrounds, augmenting its capabilities to work with 3rd party libraries.
Download it from the App Store, give it a try, and let us know what you think!
Please check out the following Bow resources. Comments and questions are welcome and encouraged!
Bow is proudly sponsored by 47 Degrees, a Functional Programming consultancy with a focus on the Scala, Kotlin, Swift, and Haskell Programming languages supporting the active development of Bow.