10 research outputs found
Named and default arguments for polymorphic object-oriented languages
This article describes the design and implementation of named and default arguments in the Scala programming language. While these features are available in many other languages there are significant differences in the actual implementations. We present a design that unifies the most reasonable properties for an object-oriented language and provides new possibilities by allowing default arguments on generic and implicit parameters. We also present a solution for the problem of writing a lightweight generic update function for algebraic datatypes
Relative Effect Declarations for Lightweight Effect-Polymorphism
Type-and-effect systems are a well-studied approach for reasoning about the computational behavior of programs. A major roadblock in adopting effect systems in popular languages is the tradeoff between expressiveness and verbosity. In this technical report, we present a syntactically lightweight but expressive system for annotating effect-polymorphic behavior of functions. The presented system is independent from any specific effect domains and can be embedded in an extensible type-and-effect system
A Flow-Insensitive, Modular Effect System for Purity
This article presents a modular, flow-insensitive type-and- effect system for purity with lightweight annotations. It does not enforce a global programming discipline and allows ar- bitrary effects to occur in impure parts of the program. The system is designed to support higher-order languages that mix functional and imperative code, such as Scala or C#. We show that it can express purity of non-local programming patterns which involve mutable state such as those used in the Scala collections library. We formalize the type system using a functional language with mutable records and define a dynamic semantics, a type safety and an effect soundness theorem
Functional Programming For All! Scaling a MOOC for Students and Professionals Alike
Massive open online courses (MOOCs) have launched a scale shift in higher education, with several individual MOOCs now boasting tens or hundreds of thousands of participants worldwide. Our MOOC on the principles of functional programming has more than 100,000 registered students to date, and boasts one of the highest rates of completion (19.2%) for its size. In this paper, we describe our experience organizing this popular MOOC, and demonstrate how providing innovative supporting tools (IDE plugins, testing frameworks, interactive build tools, automated cloud-based graders, style checkers) and considering key human-computer interaction factors potentially contributed to this markedly high completion rate. We collect an unprecedented volume of course statistics and survey results and have made them available, along with scripts for generating interactive web-based visualizations, as an open-source project
Intersection types for unbind and rebind
We define a type system with intersection types for an extension of
lambda-calculus with unbind and rebind operators. In this calculus, a term with
free variables, representing open code, can be packed into an "unbound" term,
and passed around as a value. In order to execute inside code, an unbound term
should be explicitly rebound at the point where it is used. Unbinding and
rebinding are hierarchical, that is, the term can contain arbitrarily nested
unbound terms, whose inside code can only be executed after a sequence of
rebinds has been applied. Correspondingly, types are decorated with levels, and
a term has type decorated with k if it needs k rebinds in order to reduce to a
value. With intersection types we model the fact that a term can be used
differently in contexts providing different numbers of unbinds. In particular,
top-level terms, that is, terms not requiring unbinds to reduce to values,
should have a value type, that is, an intersection type where at least one
element has level 0. With the proposed intersection type system we get
soundness under the call-by-value strategy, an issue which was not resolved by
previous type systems.Comment: In Proceedings ITRS 2010, arXiv:1101.410