Hacker News new | ask | show | jobs
by vinceguidry 4085 days ago
Type checking is typically done statically, i.e. during compile time. By the time you have AST it's too late.

Think about it, how would you handle type annotations in an agnostic type checker?

1 comments

It's definitely me being to naive, however I would type all the expression, in either the source code (into comment) or in a separate file, and all the statement.

Now I do have a table of symbols and their type.

At this point its just a matter of using the AST to being sure that everything is correctly typed...

Am I wrong ?