Unlock This Episode
Our Free plan includes 1 subscriber-only episode of your choice, plus weekly updates from our newsletter.
It has been over a year since we last talked about parsers on Point-Free, and it was more than one year before that since we first introduced the idea of parsers. There’s still so much we want to discuss when it comes to parsing, and so we are reviving the topic this week to explore some really exciting advancements we’ve made recently.
The last time we talked about parsing we heavily focused on:
- Generalization, which allows parsers to process any type of input into any type of output;
- Ergonomics, which allows us to construct parsers in the most fluent way possible; and
- Performance, which allows our parsers to be as performant as ad-hoc, hand-rolled parsers, and sometimes even more performant.
Starting this week we are going to continue a bit more with the ergonomics angle of parsing by seeing what Swift’s result builders have to offer parsing. Result builders are a relatively new feature of Swift that were primarily created in order to facilitate a concise syntax for SwiftUI views, but there are many applications for builders.
Subscribe to Point-Free
Access this episode, plus all past and future episodes when you become a subscriber.
Already a subscriber? Log in
Collection: ParsingBrandon Williams & Stephen Celis
Parsing is a surprisingly ubiquitous problem in programming. Every time we construct an integer or a URL from a string, we are technically doing parsing. After demonstrating the many types of parsing that Apple gives us access to, we will take a step back and define the essence of parsing in a single type. That type supports many wonderful types of compositions, and allows us to break large, complex parsing problems into small, understandable units.
Swift ParsingBrandon Williams & Stephen Celis • Tuesday Dec 21, 2021
A library for turning nebulous data into well-structured data, with a focus on composition, performance, generality, and invertibility.
Declarative String ProcessingAlex Alonso, Nate Cook, Michael Ilseman, Kyle Macomber, Becca Royal-Gordon, Tim Vermeulen, and Richard Wei • Wednesday Sep 29, 2021
The Swift core team’s proposal and experimental repository for declarative string processing, which includes result builder syntax for creating regular expressions, and inspired us to explore result builders for parsing.
The Many Faces of MapBrandon Williams & Stephen Celis • Monday Apr 23, 2018
Why does the
mapfunction appear in every programming language supporting “functional” concepts? And why does Swift have two
mapfunctions? We will answer these questions and show that
maphas many universal properties, and is in some sense unique.