Open Collective
Open Collective
Loading
Porting typed.spec to spec1
Published on April 15, 2021 by Ambrose Bonnaire-Sergeant

Hi,

Over the last few months I've been trying to port typed.spec to spec1 (right now it's written for spec2). The main thing that's missing in spec1 is the concept of a "symbolic spec"--effectively I need to carve out a subset of spec1 that can be treated as symbolic.

This is weirder than I expected, especially around singleton specs (set literals). For example, does #{a} stand for #{'a} or #{@'#a}? I still don't fully understand the answer, and it's quite important to typed.spec since it uses singleton specs often to instantiate type variables.

Last month I successfully wrote a compatibility layer for typed.spec that allows switching between spec1 and spec2, so I think most of the work is done. But perhaps more thinking is required to really get it working. At the moment, my feeling is that spec1 support will always be a second-class citizen due to its lack of symbolic specs, but not by much.

Ambrose