Abstract
In the past, the creators of numerical programs had to choose between simple expression of mathematical formulas and static type checking. While the Lisp family and its dynamically typed relatives support the straightforward expression via a rich numeric tower, existing statically typed languages force programmers to pollute textbook formulas with explicit coercions or unwieldy notation. In this paper, we demonstrate how the type system of Typed Racket accommodates both a textbook programming style and expressive static checking. The type system provides a hierarchy of numeric types that can be freely mixed as well as precise specifications of sign, representation, and range information—all while supporting generic operations. In addition, the type system provides information to the compiler so that it can perform standard numeric optimizations.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Buneman, P., Pierce, B.: Union types for semistructured data. In: Proc. Works. On Database Programming Languages, pp. 184–207 (1999)
Coppo, M., Dezani-Ciancaglin, M.: A new type assignment for λ-terms. Archiv Math. Logik 19, 139–156 (1978)
Dahl, O.-J.: SIMULA 67 Common Base Language. Norwegian Computing Center (1968)
Flatt, M., PLT.: Reference: Racket. PLT Inc., PLT-TR-2010-1 (2010), http://racket-lang.org/tr1/
Goldberg, A., Robson, D.: Smalltalk-80: the Language and its Implementation. Addison-Wesley (1983)
Gosling, J., Joy, B., Steele Jr., G.L., Bracha, G.: The JavaTM Language Specification, 4th edn. Addison-Wesley (2005)
ISO. ISO C Standard 1999 (1999)
Jones, M.P.: The Habit programming language: the revised preliminary report (2010)
Leroy, X., Doligez, D., Frisch, A., Garrigue, J., Rémy, D., Vouillon, J.: The Objective Caml system, Documentation and user’s manual (2010)
Lewis, P.A.W., Goodman, A.S., Miller, J.M.: A pseudo-random number generator for the System/360. IBM Systems Journal 8(2), 136–146 (1969)
Marlow, S. (ed.): Haskell 2010 Language Report (2010)
Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML, Revised edn. MIT Press (1997)
Pierce, B.C., Turner, D.N.: Local type inference. ACM Transactions on ProgrammingLanguages and Systems 22(1), 1–44 (2000)
Postel, J.: DoD standard Transmission control protocol. IETF RFC 761 (1980)
Reynolds, J.C.: Preliminary design of the programming language Forsythe. Technical report CMU-CS-88-159, Carnegie-Mellon University (1988)
Sperber, M., Flatt, M., Van Straaten, A., Kent Dybvig, R., Findler, R.B., Matthews, J.: Revised6 report on the algorithmic language Scheme. J. of Functional Programming 19(S1), 1–301 (2009)
Steele Jr., G.L.: Common Lisp: the Language, 2nd edn. Digital Press (1994)
Stroustrup, B.: The C++ Programming Language, 3rd edn. Addison-Wesley (2000)
Tobin-Hochstadt, S., Felleisen, M.: The design and implementation of Typed Scheme. In: Proc. Symp. on Principles of Programming Languages, pp. 395–406 (2008)
Tobin-Hochstadt, S., Felleisen, M.: Logical types for untyped languages. In: Proc. International Conf. on Functional Programming, pp. 117–128 (2010)
Tobin-Hochstadt, S., St-Amour, V., Culpepper, R., Flatt, M., Felleisen, M.: Languages as libraries. In: Proc. Programming Language Design and Implementation, pp. 132–141 (2011)
Wright, A.K., Cartwright, R.: A practical soft type system for Scheme. ACM Transactions on Programming Languages and Systems 19(1), 87–152 (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
St-Amour, V., Tobin-Hochstadt, S., Flatt, M., Felleisen, M. (2012). Typing the Numeric Tower. In: Russo, C., Zhou, NF. (eds) Practical Aspects of Declarative Languages. PADL 2012. Lecture Notes in Computer Science, vol 7149. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-27694-1_21
Download citation
DOI: https://doi.org/10.1007/978-3-642-27694-1_21
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-27693-4
Online ISBN: 978-3-642-27694-1
eBook Packages: Computer ScienceComputer Science (R0)