Mónika Mészáros - Academia.edu (original) (raw)
Uploads
Papers by Mónika Mészáros
Many modern functional programming languages support record types, parametric polymorphism and ty... more Many modern functional programming languages support record types, parametric polymorphism and type inference. Allowing the same field name for two different records causes a problem in these languages. Some languages (e.g. Haskell) do not let you share the same field name among record types. Other languages (e.g. Clean) take the ambiguity of field names into account when deciding the type of a record expression. In the latter case the necessary static analysis performed by the compiler tangles type inference and scope analysis, because the scope analysis of field names needs type information and vice versa. This can result in a complex type inference algorithm and hardly maintainable code in the compiler of a language supporting namespaces and records. This paper will provide a method to decouple type inference and scope analysis by using the Bottom-Up algorithm. This way an iterative algorithm with consecutive type inference and scope analysis phases can be given.
Many modern functional programming languages support record types, parametric polymorphism and ty... more Many modern functional programming languages support record types, parametric polymorphism and type inference. Allowing the same field name for two different records causes a problem in these languages. Some languages (e.g. Haskell) do not let you share the same field name among record types. Other languages (e.g. Clean) take the ambiguity of field names into account when deciding the type of a record expression. In the latter case the necessary static analysis performed by the compiler tangles type inference and scope analysis, because the scope analysis of field names needs type information and vice versa. This can result in a complex type inference algorithm and hardly maintainable code in the compiler of a language supporting namespaces and records. This paper will provide a method to decouple type inference and scope analysis by using the Bottom-Up algorithm. This way an iterative algorithm with consecutive type inference and scope analysis phases can be given.