The following pseudo-code will produce an output when it is run. While Ben is scratching his head, Alyssa P. Hacker wanders by and takes a look. With a smug grin on her face, she tells Ben that this language requires the programmer to write the types in the code. With a flip of her hair, Alyssa runs off to teach some poor fool how to fix the nozzle of his rocket engine. Fill in the blanks with the right types.
Types are useful form of documentation.
They help add redundancy to a syntax to help the programmer identify their own errors or at least the bugs in the code that the compiler finds. It also allows the compiler to check more code statically for simple braino bugs, like type mismatches. It needs to know what the base types are in the language, and what the base operations that may be performed on them are and what type signatures they have. Ben tries to recompile the code. We have a one-pass compiler.