fir-lang / fir

MIT License
23 stars 3 forks source link

Implement a type checker in the interpreter #7

Open osa1 opened 2 months ago

osa1 commented 2 months ago

Generally we should avoid adding features to the interpreter that won't make the bootstrapping easier.

However implementing a compiler without type checking will be difficult, and we won't have a good debugging tools when things go wrong. So I think we need a type checker.

The type checker in the interpreter can be simpler than the type checker in the bootstrapped compiler. For example, we can probably get away with not having higher-kinded types.

We can also avoid polymorphic anonymous types (just have simple records and variants, or maybe only records).