Skip to main content

Early Experience in Teaching the Basics of Functional Language Design with a Language Type Checker

  • Conference paper
  • First Online:
Trends in Functional Programming (TFP 2019)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12053))

Included in the following conference series:

Abstract

In this paper we set forth the thesis that a language type checker can be an effective tool in teaching language design principles of functional languages. We have used \(TypeSoundnessCertifier \), a tool for type checking languages and certifying their soundness, in the context of a graduate course in programming languages. In this paper we offer details on how the course took place, and we report on some data gathered during evaluations. Although the work reported in this paper is not statistically significant, we share our experience to show the type of studies that we are conducting, and to inspire similar and larger studies towards gathering evidence for, or against, our thesis.

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 EPUB and 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

Notes

  1. 1.

    A constraint of our system is that it works with closed terms as values, therefore a variable x cannot be declared as a value.

  2. 2.

    This is not a novelty. The Ott language, for example, achieved the same effect previously.

  3. 3.

    For those language definitions that \(TypeSoundnessCertifier \) type check as type sound, the tool also produces a machine-checked proof in the Abella theorem prover [1, 4], hence the name of the tool. However, we are not concerned with this aspect of the tool.

  4. 4.

    Advanced features included monads, gradual typing [16, 17], and data race freedom in the Rust type system, to name a few.

  5. 5.

    Since a solution for the ordinary filter operation is comparable to that of \(\mathtt {map}\), and \(\mathtt {map}\) has been given as exercise (see Sect. 2.2), we preferred to make the exam more difficult with \(\mathtt {filterOpt}\).

References

  1. Abella Development Team. http://abella-prover.org

  2. Altenkirch, T., Reus, B.: Monadic presentations of lambda terms using generalized inductive types. In: Flum, J., Rodriguez-Artalejo, M. (eds.) CSL 1999. LNCS, vol. 1683, pp. 453–468. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48168-0_32. http://dl.acm.org/citation.cfm?id=647849.737066

    Chapter  Google Scholar 

  3. Augustsson, L., Carlsson, M.: An exercise in dependent types: a well-typed interpreter. In: Workshop on Dependent Types in Programming, Gothenburg (1999)

    Google Scholar 

  4. Baelde, D., Chaudhuri, K., Gacek, A., Miller, D., Nadathur, G., Tiu, A., Wang, Y.: Abella: a system for reasoning about relational specifications. J. Formaliz. Reason. 7(2), 1–89 (2014). https://doi.org/10.6092/issn.1972-5787/4650

    Article  MathSciNet  MATH  Google Scholar 

  5. Cheney, J.: Toward a general theory of names: binding and scope. In: Proceedings of the 3rd ACM SIGPLAN Workshop on Mechanized Reasoning About Languages with Variable Binding, MERLIN 2005, pp. 33–40. ACM, New York (2005). http://doi.acm.org/10.1145/1088454.1088459

  6. Cimini, M.: TypeSoundnessCertifier (2015). https://github.com/mcimini/TypeSoundnessCertifier

  7. Cimini, M., Miller, D., Siek, J.G.: Well-typed languages are sound. CoRR abs/1611.05105 (2016). http://arxiv.org/abs/1611.05105

  8. D’Antoni, L., Weavery, M., Weinert, A., Alur, R.: Automata tutor and what we learned from building an online teaching tool. Bull. EATCS 117 (2015). http://eatcs.org/beatcs/index.php/beatcs/article/view/365

  9. Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. The MIT Press, London (2009)

    MATH  Google Scholar 

  10. Harper, R.: Practical Foundations for Programming Languages. Cambridge University Press, New York (2012)

    Book  Google Scholar 

  11. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

    MATH  Google Scholar 

  12. Pierce, B.C., et al.: Software Foundations. Electronic textbook (2014). www.cis.upenn.edu/~bcpierce/sf

  13. Poulsen, C.B., Rouvoet, A., Tolmach, A., Krebbers, R., Visser, E.: Intrinsically-typed definitional interpreters for imperative languages 2(POPL), 16:1–16:34 (2018). https://doi.org/10.1145/3158104

    Article  Google Scholar 

  14. Reynolds, J.C.: The meaning of types - from intrinsic to extrinsic semantics (2000)

    Google Scholar 

  15. Sewell, P., et al.: Ott: effective tool support for the working semanticist. In: Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, ICFP 2007, Freiburg, Germany, 1–3 October 2007, pp. 1–12 (2007). https://doi.org/10.1145/1291151.1291155

  16. Siek, J.G., Taha, W.: Gradual typing for functional languages. In: Scheme and Functional Programming Workshop, pp. 81–92, September 2006

    Google Scholar 

  17. Tobin-Hochstadt, S., Felleisen, M.: Interlanguage migration: from scripts to programs. In: Companion to the 21st ACM SIGPLAN Symposium on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 2006, pp. 964–974. ACM, New York (2006). https://doi.org/10.1145/1176617.1176755, http://doi.acm.org/10.1145/1176617.1176755

Download references

Acknowledgements

We thank Dale Miller and Jeremy Siek for their comments on Sect. 1.1. We are thankful to our anonymous reviewers for their suggestions, which improved this paper. Also, we thank the students who participated to the study being reported.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Matteo Cimini .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Cimini, M. (2020). Early Experience in Teaching the Basics of Functional Language Design with a Language Type Checker. In: Bowman, W., Garcia, R. (eds) Trends in Functional Programming. TFP 2019. Lecture Notes in Computer Science(), vol 12053. Springer, Cham. https://doi.org/10.1007/978-3-030-47147-7_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-47147-7_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-47146-0

  • Online ISBN: 978-3-030-47147-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics