“Completions are powered by the presentation compiler”. I remember the first time I read this phrase. As someone that was fairly new to Scala, new

An intro to the Scala Presentation Compiler

submited by
Style Pass
2021-07-15 21:00:01

“Completions are powered by the presentation compiler”. I remember the first time I read this phrase. As someone that was fairly new to Scala, new to working in tooling, and had never touched the internals of a compiler before, this phrase made absolutely no sense to me. I had no idea what the presentation compiler was, where it was located, and definitely no idea of how to use it. To be honest, I was also a bit afraid to even ask those questions. Often when we see phrases like “it’s simple” or “it’s easy”, it really just means “I’m familiar with this”.

A lot of topics in tooling seem to be less covered than those of hot libraries or general programming paradigms, which totally makes sense. There is a much smaller group of people working in this area. However, it does then make it a bit harder to get started. Thankfully, the Scala tooling ecosystem is packed full of friendly helpful people that have always been more than helpful whenever I’ve gotten stuck or had no clue where to start with something. Plus a lot of the Scala documentation is incredibly useful and underappreciated. Like this page on Trees, which will be relevant for what I show down below.

The goal for this post is so that hopefully when someone in the future hears a phrase about the presentation compiler and has no idea what it is, this can serve as introduction to what it is, where to find it, and as an example of how to use it. When I first started searching around for these answers I came across a few useful sources that I’ll reference since they helped me:

Leave a Comment