We mentioned earlier that the compiler will raise errors if it cannot make sense of a piece of code it comes across. There are a few different kinds of compiler errors, and they are as follows
- Syntax errors
- Type errors
- Name errors
- Stale interface errors (which we'll cover in the next chapter)
- Compiler bugs (these are rare but shouldn't be discounted)
The two most common types of error that we will deal with are syntax errors and type errors. Name errors are fairly simple to avoid: always start type names with a lowercase letter and ensure that the names you refer to in your code were defined before you refer to them. (Reason supports cyclic references but not forward references; we'll cover cyclic references later on.)