We are absolutely swimming in little languages. Consider these languages:<p>- The language of regular expressions<p>- SQL queries<p>- In web frameworks, the language of routes<p>- etc.<p>Unfortunately we embed a lot of these languages as strings. This is problematic because the language usually sees just opaque strings—we can't apply any of our lovely static analysis tools to these little embedded languages.<p>I'm doing some research in this area. We just got a paper published at ECOOP. The big idea is that, with a little bit of clever metaprogramming, we can help the type checker understand these little languages better and give us more helpful hints or execute more efficiently. This isn't a new idea, but no one has given it a name before. Here's the blog post version: <a href="https://lambdaland.org/posts/2024-07-15_type_tailoring/" rel="nofollow">https://lambdaland.org/posts/2024-07-15_type_tailoring/</a><p>(HN discussion): <a href="https://news.ycombinator.com/item?id=40990232">https://news.ycombinator.com/item?id=40990232</a>