In my opinion, most, if not all, the compiler does not check if a function exists during compilation. What is required in the general case is the declaration of a function prototype: the type of the return value, the list, and the type of all arguments. This is done in C / C ++ by including some_file.h in each module definition (not .c or .cpp).
Erlang checks this type dynamically and the program runs, so there is no need to include these definitions. This is even completely useless, because Erlang allows you to update the application while it is running, so the type of function may change, or the function may disappear, intentionally or by mistake, during the life of the application; therefore, the Erlang designer decided to conduct this check at runtime rather than at build time.
The error you are talking about usually occurs during the link phase of code generation, when the "compiler" tries to collect all the separate parts of the object code to create an executable file or library, at this point the linker solves all external addresses (for a shared variable, a static call ...). This phase does not exist in Erlang, the module is completely autonomous; it does not participate with the rest of the application, nor with the parameter, nor with the address of the function.
Of course, you need to use some tools and perform some tests before updating the current production program, but I believe that these checks have the same level of importance as the correctness of the algorithm itself.
source share