Explore compile-time checking for embedded domain-specific languages (DSLs) in Scala using the Contextual library in this Scala Days Copenhagen 2017 conference talk. Learn how to create string interpolators that perform parsing and validation at compile-time without writing macros. Discover techniques for implementing custom error messages and adding compile-time safety to Scala code. Dive into practical examples of creating literal-like types for email addresses, URLs, YAML, CSS, and even Haskell. Gain insights into the TyperAPI, extension methods, and the inner workings of Contextual. Follow along with demonstrations of various interpolators, including ObjectID, CSS, and XML examples. Understand how to leverage Contextual for parsing, validation, and creating custom literal types to enhance code safety and expressiveness in Scala projects.
Easy Static Checking for Embedded DSLs in Scala with Contextual