Daniel Sosebee
05/17/2024, 8:42 PMJoshua Horowitz
05/17/2024, 11:34 PMVect n a
meaning “a vector of n elements of type a”, and then you can write an “append” function with type Vect n a -> Vect m a -> Vect (n + m) a
. Using functions like this, you propagate information about the lengths of vectors as you perform computations on them.
re #2: Neat idea. This may be less ambitious than you’re thinking, but I can imagine an IDE feature saying “turn the inferred type of this value into an explicit type annotation”. That way, you can make types explicit before a refactor to make sure you’re not changing types as you refactor.
re all: Your interests here seem related to software verification and other “formal methods”. In case you haven’t seen that stuff, I’d suggest Dafny as an accessible starting point. It lets you write functions accompanied by logical specifications the functions are supposed to satisfy, and then to guide the system to proving that the functions satisfy these specifications. (Most systems like this cannot be automated in the same way that type inference is automated, because once you want to prove general properties of programs like “functions f and g do the same thing”, you get into things that are not computable in principle.)Nilesh Trivedi
05/18/2024, 1:40 AMKonrad Hinsen
05/18/2024, 5:15 AMa type system that somehow captures all information possible about every value in a codebaseFirst thought: "all possible information" about a value includes the value itself. And then you quickly get to dependent types, as @Joshua Horowitz suggested. A more difficult problem is exploiting all that information in a useful way, i.e. come up with useful inference rules. I doubt that a single set of rules, i.e. a single type system, can capture all useful inferences while remaining usable. Unfortunately, the dogma of "thou shalt not have any type system other than the one of your one and only programming language" is rarely challenged.
wtaysom
05/21/2024, 7:30 AMwtaysom
05/21/2024, 7:32 AMDaniel Sosebee
05/25/2024, 4:48 PMwtaysom
05/27/2024, 7:30 AMCole
07/04/2024, 5:00 PMcursor/debug
mentioned in this post. Then, the work on replay.io is pretty interesting.