Making a type class that expresses Lua's syntax and semantics will require novel techniques.
Since the language is mutable, and statements can't be put into expressions, the type class has to represent that, in addition to typing mutability somehow. This will look like an effect system, but be a bit different.
https://richarde.dev/papers/2021/linear-constraints/linear-constraints.pdf is a good resource for some ideas.
Making a type class that expresses Lua's syntax and semantics will require novel techniques. Since the language is mutable, and statements can't be put into expressions, the type class has to represent that, in addition to typing mutability somehow. This will look like an effect system, but be a bit different. https://richarde.dev/papers/2021/linear-constraints/linear-constraints.pdf is a good resource for some ideas.