The polymorphism looks a little half-missing as well (checker.c):
/* generalize: check if vars in t are free (not bound in env).
For now, a simplified version that just returns the type as-is. */
CkType *ck_generalize(CkTypeEnv *env, CkType *t) {
So the identity func (id x = x) stays a monotype?Also, I'm not seeing any more or less safety in this code than the surrounding code:
/* thread-safe version that returns allocated string */
static char *type_to_str_alloc(CkType \*t) {
char buf[512];
type_to_buf(t, buf, sizeof buf);
return xs_strdup(buf);
}
Are multiple type-checking threads blasting through this at the same time?The most interesting claim that this file makes is that it does HM-inference as well as subtyping. I'm smart enough to parrot "that's undecidable" even if I'm too dumb to know why.
HM is hard enough without taking the sizeof pointers and mallocing every few lines.