Typing the Numeric Tower

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.

[1]  Mariangiola Dezani-Ciancaglini,et al.  A new type assignment for λ-terms , 1978, Arch. Math. Log..

[2]  R. Kent Dybvig,et al.  Revised6 Report on the Algorithmic Language Scheme , 2009 .

[3]  Guy L. Steele,et al.  Common Lisp the Language , 1984 .

[4]  Ole-Johan Dahl,et al.  SIMULA 67 common base language, (Norwegian Computing Center. Publication) , 1968 .

[5]  P. A. W. Lewis,et al.  A Pseudo-Random Number Generator for the System/360 , 1969, IBM Syst. J..

[6]  Benjamin C. Pierce,et al.  Local type inference , 1998, POPL '98.

[7]  Jr. Guy L. Steele,et al.  Common LISP: the language (2nd ed.) , 1990 .

[8]  Sam Tobin-Hochstadt,et al.  Languages as libraries , 2011, PLDI '11.

[9]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[10]  Jon Postel,et al.  DOD standard transmission control protocol , 1980, CCRV.

[11]  Robert Cartwright,et al.  A practical soft type system for scheme , 1997, TOPL.

[12]  Sam Tobin-Hochstadt,et al.  Logical types for untyped languages , 2010, ICFP '10.

[13]  Sam Tobin-Hochstadt,et al.  The design and implementation of typed scheme , 2008, POPL '08.

[14]  Bjarne Stroustrup,et al.  The C++ Programming Language, 4th Edition , 2013 .

[15]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[16]  Harold Abelson,et al.  Revised5 report on the algorithmic language scheme , 1998, SIGP.

[17]  David B. MacQueen,et al.  The Definition of Standard ML (Revised) , 1997 .

[18]  M. F.,et al.  Bibliography , 1985, Experimental Gerontology.

[19]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

[20]  Peter Buneman,et al.  Union Types for Semistructured Data , 1999, DBPL.

[21]  Simon Marlow,et al.  Haskell 2010 Language Report , 2010 .

[22]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[23]  Robin Milner,et al.  Definition of standard ML , 1990 .

[24]  John C. Reynolds,et al.  Preliminary design of the programming language Forsythe , 1988 .

[25]  Benjamin C. Pierce,et al.  Local type inference , 2000, TOPL.