[HN Gopher] Type Inference Zoo
___________________________________________________________________
Type Inference Zoo
Author : mpweiher
Score : 153 points
Date : 2025-06-18 08:02 UTC (4 days ago)
(HTM) web link (zoo.cuichen.cc)
(TXT) w3m dump (zoo.cuichen.cc)
| flashgordon wrote:
| This is amazing. I've been wanting to do this for ages (even
| tried a few times and failed a few times). Great to see this.
| dmkolobov wrote:
| It is crazy how much work comes out of Bruno Oliveira's research
| groups.
|
| Another cool online thing that exists is CP, a language with
| disjoint intersection and union types:
|
| https://github.com/yzyzsun/CP-next
| gavinray wrote:
| TypeScript has this functionality.
|
| Additionally, Scala 3 does as well, including support for these
| generic "Type-Lambda" expressions I saw in one of the examples
| on the playground:
|
| https://beta.plground.org/jnclma/CP_tutorial
| printNum = trait implements ExpSig<Eval => Print> {
|
| In Scala 3, this would be roughly: trait
| ExpSig[F[_]] object printNum extends ExpSig[[A] =>>
| Eval[A] => Print]
|
| https://docs.scala-lang.org/scala3/reference/new-types/type-...
| b0a04gl wrote:
| huh funny how python's doing the job of modeling type systems
| when it barely enforces types itself. but makes sense the more u
| poke around. didn't have to fight any compiler layer or deal with
| noise. could just build the inference logic raw, decide how types
| get unified, how ctx gets stored, all that. no annotations or
| weird conversions. the language just stepped aside so i could
| focus. actually helped my brain map the theory better ngl
| b00ty4breakfast wrote:
| >uh funny how python's doing the job of modeling type systems
| when it barely enforces types itself
|
| The magic of computers. You can write a standards-compliant
| Lisp interpreter in python, too and it doesn't have a large
| chunk of that stuff in itself either.
___________________________________________________________________
(page generated 2025-06-22 23:01 UTC)