skip to main content
US FlagAn official website of the United States government
dot gov icon
Official websites use .gov
A .gov website belongs to an official government organization in the United States.
https lock icon
Secure .gov websites use HTTPS
A lock ( lock ) or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.


Title: Codata in Action
Computer scientists are well-versed in dealing with data structures. The same cannot be said about their dual: codata. Even though codata is pervasive in category theory, universal algebra, and logic, the use of codata for programming has been mainly relegated to representing infinite objects and processes. Our goal is to demonstrate the benefits of codata as a general-purpose programming abstraction independent of any specific language: eager or lazy, statically or dynamically typed, and functional or object-oriented. While codata is not featured in many programming languages today, we show how codata can be easily adopted and implemented by offering simple inter-compilation techniques between data and codata. We believe codata is a common ground between the functional and object-oriented paradigms; ultimately, we hope to utilize the Curry-Howard isomorphism to further bridge the gap.  more » « less
Award ID(s):
1719158
PAR ID:
10097142
Author(s) / Creator(s):
; ; ;
Date Published:
Journal Name:
Programming Languages and Systems. ESOP 2019
Page Range / eLocation ID:
119--146
Format(s):
Medium: X
Sponsoring Org:
National Science Foundation
More Like this
  1. Researchers have looked into ways to make computer science assignments more engaging, practical, and beneficial to students to improve learning outcomes by increasing student appeal. Offering a pool of assignments and allowing students to choose their preferred assignments is considered as a potential method for improving learning outcomes. In this paper, we investigate the effect of context choice for assignments in an object-oriented programming course that covers various topics such as object-oriented programming concepts, database design and implementation, graphical user interface design, and web application development. Students complete three immersive simulation-based learning (ISBL) modules as course assignments. ISBL modules involve technology-enhanced problem-based learning where the problem context is represented via a three-dimensional (3D), animated discrete-event simulation model that resembles a real-world system or context, in this case, we have three simulated systems/contexts around which ISBL assignments are defined: an airport, a manufacturing system, and a hospital emergency department. The research experiments involve four groups: (1) students with no choice who use the same assigned simulated system for all three ISBL assignments; (2) students with no choice who are given a different simulated system for each ISBL assignment; (3) students who can choose their preferred simulated system at the beginning but cannot change their choice for future assignments; and, (4) students who can choose at the beginning and switch between the three simulated systems for subsequent assignments. Data are collected over multiple semesters and statistical analyses are conducted to compare the four groups in terms of motivation, experiential learning, and self assessment of learning. We also conduct qualitative assessments in the form of interviews to support and explain our statistical results. 
    more » « less
  2. Identifying similar code in software systems can assist many software engineering tasks such as program understanding and software refactoring. While most approaches focus on identifying code that looks alike, some techniques aim at detecting code that functions alike. Detecting these functional clones - code that functions alike - in object oriented languages remains an open question because of the difficulty in exposing and comparing programs' functionality effectively. We propose a novel technique, In-Vivo Clone Detection, that detects functional clones in arbitrary programs by identifying and mining their inputs and outputs. The key insight is to use existing workloads to execute programs and then measure functional similarities between programs based on their inputs and outputs, which mitigates the problems in object oriented languages reported by prior work. We implement such technique in our system, HitoshiIO, which is open source and freely available. Our experimental results show that HitoshiIO detects more than 800 functional clones across a corpus of 118 projects. In a random sample of the detected clones, HitoshiIO achieves 68+% true positive rate with only 15% false positive rate. 
    more » « less
  3. Chung-Kil Hur (Ed.)
    Dynamic object-oriented languages, such as Python, Ruby, and Javascript are widely used nowadays. A distinguishing feature of dynamic object-oriented languages is that objects, the fundamental runtime data representation, are highly dynamic, meaning that a single constructor may create objects with different types and objects can evolve freely after their construction. While such dynamism facilitates fast prototyping, it brings many challenges to program understanding. Many type systems have been developed to aid programming understanding, and they adopt various types and techniques to represent and track dynamic objects. However, although many types and techniques have been proposed, it is unclear which one suits real dynamic object usages best. Motivated by this situation, we perform an empirical study on 50 mature Python programs with a focus on object dynamism and object type models. We found that (1) object dynamism is highly prevalent in Python programs, (2) class-based types are not precise to handle dynamic behaviors, as they introduce type errors for 52% of the evaluated polymorphic attributes, (3) typestate-based types, although mostly used in static languages, matches the behaviors of dynamic objects faithfully, and (4) some well-designed but still lightweight techniques for objectbased types, such as argument type separation and recency abstraction can precisely characterize dynamic object behaviors. Those techniques are suitable for building precise but still concise object-based types. 
    more » « less
  4. null (Ed.)
    Ownership type systems, based on the idea of enforcing unique access paths, have been primarily focused on objects and top-level classes. However, existing models do not as readily reflect the finer aspects of nested lexical scopes, capturing, or escaping closures in higher-order functional programming patterns, which are increasingly adopted even in mainstream object-oriented languages. We present a new type system, λ * , which enables expressive ownership-style reasoning across higher-order functions. It tracks sharing and separation through reachability sets, and layers additional mechanisms for selectively enforcing uniqueness on top of it. Based on reachability sets, we extend the type system with an expressive flow-sensitive effect system, which enables flavors of move semantics and ownership transfer. In addition, we present several case studies and extensions, including applications to capabilities for algebraic effects, one-shot continuations, and safe parallelization. 
    more » « less
  5. Pausing behavior in introductory Computer Science (CS1) courses has been related to course outcomes and could be linked to a student’s cognitive load. Using Cognitive Load Theory and Vygotsky’s Zone of Proximal Development as a theoretical framework, this study empirically analyzes keystroke latencies, or pause times between keystrokes, with the goal of better understanding what types of assignments need more scaffolding than others. We report the characteristics of eleven assignments, introduce a method to analyze pausing behavior, and investigate how pausing behavior changes with assignment characteristics (e.g., introducing new programming constructs, engaging creativity through Turtle graphics, etc). We find evidence that pausing behavior does change based on the assignment characteristics and that assignments with particular characteristics, such as object-oriented principles, may be more likely to have excessive demands on student working memory. We also find evidence that assignment completion time may not be an accurate measure of assignment difficulty. 
    more » « less