A functional programming group for those living and working in Bucharest
We gather monthly, watch someone talk about something they're passionate about and then continue the discussion in a pub
#021: Parsing: How Does it Work?
This meetup took place at the Eloquentix office, Wednesday, 20 April 2016 at 19:00. Find out when our next meetup is.
Parsing: How Does it Work?
Ionuț G. Stan
Ionuț is a software developer at Eloquentix, where he works on backend services using Scala. His current interests revolve around functional programming techniques, programming languages and compilers.
Transforming text to some in-memory data structure — parsing, as it's usually called — is perceived as a form of black magic. It looks like a complicated thing to do and parsing an actual programming language even more so. It is actually held in such a high regard that some people seem to mistake parsing for the task of writing a compiler or interpreter in its entirety, which is certainly not the case.
While not always a trivial task, parsing is probably easier than you think and I'll try to prove it during this presentation. We'll see how a stream of characters is transformed into a stream of tokens, which are then fed to the parser proper that will finally derive an in-memory tree data structure. I will be using Scala as the implementation language and a subset of Standard ML as the language to parse.