Generates thread-safe C code from a description of the type given in lua