ssm-lang / Scoria

This is an embedding of the Sparse Synchronous Model, in Haskell!
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Type checker #37

Open Rewbert opened 3 years ago

Rewbert commented 3 years ago

It would be nice if we could have a type checker of SSM.Core.Syntax programs. This would be handy when I am implementing the shrinking stuff, to make sure that a shrinking step doesn't produce an illegal program. Any program should be type-safe both before & after shrinking.

It would be quite a simple exercise, as the language has no polymorphic types or anything fancy like that. It would just be a simple check/inference.

j-hui commented 3 years ago

This is a great idea. I found a (harmless) type error in ManyConts, assining a signed int to an unsigned int. I only found it because I noticed gcc warning me about it; this should have been caught before the C file was ever produced.