Skip to main content

Typing the Numeric Tower

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2012)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7149))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Buneman, P., Pierce, B.: Union types for semistructured data. In: Proc. Works. On Database Programming Languages, pp. 184–207 (1999)

    Google Scholar 

  2. Coppo, M., Dezani-Ciancaglin, M.: A new type assignment for λ-terms. Archiv Math. Logik 19, 139–156 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  3. Dahl, O.-J.: SIMULA 67 Common Base Language. Norwegian Computing Center (1968)

    Google Scholar 

  4. Flatt, M., PLT.: Reference: Racket. PLT Inc., PLT-TR-2010-1 (2010), http://racket-lang.org/tr1/

  5. Goldberg, A., Robson, D.: Smalltalk-80: the Language and its Implementation. Addison-Wesley (1983)

    Google Scholar 

  6. Gosling, J., Joy, B., Steele Jr., G.L., Bracha, G.: The JavaTM Language Specification, 4th edn. Addison-Wesley (2005)

    Google Scholar 

  7. ISO. ISO C Standard 1999 (1999)

    Google Scholar 

  8. Jones, M.P.: The Habit programming language: the revised preliminary report (2010)

    Google Scholar 

  9. Leroy, X., Doligez, D., Frisch, A., Garrigue, J., Rémy, D., Vouillon, J.: The Objective Caml system, Documentation and user’s manual (2010)

    Google Scholar 

  10. 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)

    Article  Google Scholar 

  11. Marlow, S. (ed.): Haskell 2010 Language Report (2010)

    Google Scholar 

  12. Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML, Revised edn. MIT Press (1997)

    Google Scholar 

  13. Pierce, B.C., Turner, D.N.: Local type inference. ACM Transactions on ProgrammingLanguages and Systems 22(1), 1–44 (2000)

    Article  Google Scholar 

  14. Postel, J.: DoD standard Transmission control protocol. IETF RFC 761 (1980)

    Google Scholar 

  15. Reynolds, J.C.: Preliminary design of the programming language Forsythe. Technical report CMU-CS-88-159, Carnegie-Mellon University (1988)

    Google Scholar 

  16. 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)

    Article  MathSciNet  MATH  Google Scholar 

  17. Steele Jr., G.L.: Common Lisp: the Language, 2nd edn. Digital Press (1994)

    Google Scholar 

  18. Stroustrup, B.: The C++ Programming Language, 3rd edn. Addison-Wesley (2000)

    Google Scholar 

  19. Tobin-Hochstadt, S., Felleisen, M.: The design and implementation of Typed Scheme. In: Proc. Symp. on Principles of Programming Languages, pp. 395–406 (2008)

    Google Scholar 

  20. Tobin-Hochstadt, S., Felleisen, M.: Logical types for untyped languages. In: Proc. International Conf. on Functional Programming, pp. 117–128 (2010)

    Google Scholar 

  21. 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)

    Google Scholar 

  22. Wright, A.K., Cartwright, R.: A practical soft type system for Scheme. ACM Transactions on Programming Languages and Systems 19(1), 87–152 (1997)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics