Abstract
AbstractIn this paper, we describe our experience incorporating gradual types in a statically typed functional language with Hindley-Milner style type inference. Where most gradually typed systems aim to improve static checking in a dynamically typed language, we approach it from the opposite perspective and promote dynamic checking in a statically typed language. Our approach provides a glimpse into how languages like SML and OCaml might handle gradual typing. We discuss our implementation and challenges faced—specifically how gradual typing rules apply to our representation of composite and recursive types. We review the various implementations that add dynamic typing to a statically typed language in order to highlight the different ways of mixing static and dynamic typing and examine possible inspirations while maintaining the gradual nature of our type system. This paper also discusses our motivation for adding gradual types to our language, and the practical benefits of doing so in our industrial setting.
Publisher
Springer International Publishing
Reference34 articles.
1. Using Type Dynamic. https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/types/using-type-dynamic. Accessed 02 Jan 2021
2. Abadi, M., Cardelli, L., Pierce, B., Plotkin, G.: Dynamic typing in a statically typed language. ACM Trans. Program. Lang. Syst. (TOPLAS) 13(2), 237–268 (1991)
3. Balestrieri, F., Mauny, M.: Generic programming in OCaml. Electron. Proc. Theor. Comput. Sci. 285, 59–100 (2018). https://doi.org/10.4204/EPTCS.285.3
4. Damas, L., Milner, R.: Principal type-schemes for functional programs. In: Proceedings of the 9th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 207–212 (1982)
5. Garcia, R., Cimini, M.: Principal type schemes for gradual programs. SIGPLAN Not. 50(1), 303–315 (2015). https://doi.org/10.1145/2775051.2676992