Papers
Topics
Authors
Recent
Search
2000 character limit reached

Disco: A Functional Programming Language for Discrete Mathematics

Published 14 Aug 2023 in cs.PL and cs.DM | (2308.06971v1)

Abstract: Disco is a pure, strict, statically typed functional programming language designed to be used in the setting of a discrete mathematics course. The goals of the language are to introduce students to functional programming concepts early, and to enhance their learning of mathematics by providing a computational platform for them to play with. It features mathematically-inspired notation, property-based testing, equirecursive algebraic types, subtyping, built-in list, bag, and finite set types, a REPL, and student-focused documentation. Disco is implemented in Haskell, with source code available on GitHub [https://github.com/disco-lang/disco], and interactive web-based REPL available through replit [https://replit.com/@BrentYorgey/Disco#README.md].

Citations (1)

Summary

  • The paper presents Disco, a functional programming language that simplifies discrete mathematics education while ensuring mathematical rigor.
  • Disco employs a pure, statically typed system with equirecursive types and subtyping to mirror standard mathematical notation.
  • The language’s cloud-based implementation streamlines classroom use by reducing setup complexities and boosting student engagement.

Overview of "Disco: A Functional Programming Language for Discrete Mathematics"

The paper introduces Disco, a functional programming language tailored for educational use in discrete mathematics courses. Developed by Brent A. Yorgey, Disco aims to facilitate the pedagogical integration of discrete mathematics and functional programming by providing a language that simplifies complex functional programming concepts while maintaining mathematical rigor. Disco is designed specifically for teaching, eschewing the complexities unnecessary for educational contexts, such as those found in general-purpose functional languages like Haskell or OCaml.

Language Design and Features

Disco is characterized as a pure, strict, statically typed functional programming language with features that reduce the incidental complexity typically seen in other programming languages. It supports features like property-based testing, equirecursive algebraic types, and subtyping. The language offers a repertoire that aligns more closely with standard mathematical notation, thereby smoothing the transition from mathematics to programming for students. Examples mentioned in the paper illustrate how Disco allows for intuitive mathematical expressions, such as arithmetic patterns, set operations, and case expressions, through a syntax which mirrors typical mathematical practices.

Pedagogical Motivation and Implementation

The pedagogical underpinnings of Disco are deeply rooted in the need to introduce functional programming early in the computer science educational pipeline. By embedding programming exercises into the discrete mathematics curriculum—a course often required early in undergraduate programs—students can experience functional programming in a context that also relates directly to core mathematical concepts. Such alignment promises to make abstract concepts more tangible and approachable, heighten student engagement, and level the playing field between mathematics and computer science students by providing a shared computational framework.

A noteworthy aspect of Disco’s implementation is its construction in Haskell, with a focus on accessibility through cloud-based interaction platforms like Replit. This feature relieves students from the burden of local setup and resource management, allowing them to focus on learning rather than toolchain configurations.

Type System and Subtyping

Disco's type system, which incorporates structural subtyping, qualified parametric polymorphism, and equirecursive types, is pivotal in enabling intuitive type usage akin to mathematical sets while maintaining computational soundness. The subtyping, for instance, supports natural mathematical casting, allowing seamless integration of natural numbers, integers, fractions, and rational numbers in discrete operations. This mimics the mathematical practice wherein types are often fluidly interpreted based on context rather than formal restrictions.

Practical Experiences and Challenges

In practical applications, as mentioned in the paper, Disco has been employed in classroom settings, demonstrating potential in enhancing students' understanding of both programming and mathematical concepts. However, challenges remain, particularly in terms of error messaging, which can sometimes lack clarity, potentially stifling novice learner engagement.

Future Directions

The paper concludes by recognizing the potential for refining Disco's type-checking processes, error reporting, and possible integration with formal proof systems to extend its utility in proof-writing contexts. Enhancing Disco’s integration into broader educational tools and ecosystems could further solidify its position as an educational language.

In summary, Disco represents a strategic alignment between programming pedagogy and mathematical education, providing a unique approach to teaching foundational computer science concepts. It serves as a launchpad for discussions about the intersection of mathematical education and computational thinking and presents numerous opportunities for further refinement and application in educational contexts.

Paper to Video (Beta)

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Continue Learning

We haven't generated follow-up questions for this paper yet.

Authors (1)

Collections

Sign up for free to add this paper to one or more collections.