Back to articles
Tsonnet #31 - Taking back control of equality
NewsTools

Tsonnet #31 - Taking back control of equality

via Dev.toHercules Lemke Merscher

Welcome to the Tsonnet series! If you're not following along, check out how it all started in the first post of the series . In the previous post, I implemented the equality operator: Tsonnet #30 - Dabbling with equality Hercules Lemke Merscher ・ Jan 30 '25 #tsonnet #jsonnet #compiler In a messy way, I should say. So, let's take back control. Encoding the compiler phases as phantom types In the previous post I mentioned this, and it was my initial idea. The premise has its merit. We encode each compiler phase in the type system, as each phase will only deal with AST variants that matter in that stage. I still believe this should be the end state of the compiler, but I played with it, and decided not to pursue this path. At least, not yet. I made a quick and dirty attempt, you can see the diff here , but in the end, I was not satisfied with how it turned out. Why? Because it introduced too much noise, and made the code brittle, IMO. I don't want to enforce too much strictness at this po

Continue reading on Dev.to

Opens in a new tab

Read Full Article
0 views

Related Articles