作者: Mark Shields , Tim Sheard , Simon Peyton Jones
关键词: Type inference 、 Computer science 、 Programming language 、 Data type 、 Manifest typing 、 Type system 、 Strong and weak typing 、 Operational semantics 、 Duck typing 、 Parametric polymorphism 、 Theoretical computer science
摘要: Dynamic typing extends statically typed languages with a universal datatype, simplifying programs which must manipulate other as data, such distributed, persistent, interpretive and generic programs. Current approaches, however, limit the use of polymorphism in dynamic values, can be syntactically awkward.We introduce new approach to typing, based on staged computation, allows single type-reconstruction algorithm execute partly at compile time run-time. This seamlessly type system accommodate types that are only known run-time, while still supporting both inference polymorphism. The is significantly more expressive than approaches. Furthermore it implemented efficiently; most done compile-time, leaving some residual unification for run-time.We demonstrate our by examples small polymorphic functional language, present its system, reconstruction algorithm, operational semantics. Our proposal could also readily adapted many programming languages.