Pardon my english. I am recently trying to understand the different parts of a compiler and to implement them with a play language. I am wondering what the jobs of a semantic analyzer is, because many things that I read that a semantic analyzer is supposted to do are not really for dynamic languages, such as type checking, scope checking, etc. because those things are checked at run time.
So I think a few of the jobs of a semantic analyzer for a dynamic language (like LUA or PYTHON or RUBY) are to
- make sure that assignments are not bad like 1 = a or 5 = 5
However, I am not sure what other jobs the semantic analasis phase of a compiler for dynamic languages are. It seems that it has a very small job to do in dynamic languages because most is done at run time. What other common jobs does the semantic analyzer take care of for dynamic languages? I feel as I am missing much of the part of semantic analasis. Thank you.