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.