554 research outputs found
Fighting bit Rot with Types (Experience Report: Scala Collections)
We report on our experiences in redesigning Scala\u27s collection
libraries, focussing on the role that type systems play in keeping
software architectures coherent over time. Type systems can make
software architecture more explicit but, if they are too weak, can
also cause code duplication. We show that code duplication can be
avoided using two of Scala\u27s type constructions: higher-kinded types
and implicit parameters and conversions
Proof of the principal type property for system O
We study a minimal extension of the Hindley/Milner system that
supports overloading and polymorphic records.
We also show that every typable term in this system has a
principal type and give an algorithm to reconstruct that type.
We give the proofs for termination, soundness and correctness for
the constrained unification and the type reconstruction algorithm
Simple algebraic data types for C
ADT is a simple tool in the spirit of Lex and Yacc that makes algebraic data types and a restricted form of pattern matching on those data types as found in SML available in C programs. ADT adds runtime checks, which make C programs written with the aid of ADT less likely to dereference a NULL pointer. The runtime tests may consume a significant amount of CPU time; hence they can be switched off once the program is suitably debugged
A confluent calculus for concurrent constraint programming with guarded choice
. Confluence is an important and desirable property as it allows the program to be understood by considering any desired scheduling rule, rather than having to consider all possible schedulings. Unfortunately, the usual operational semantics for concurrent constraint programs is not confluent as different process schedulings give rise to different sets of possible outcomes. We show that it is possible to give a natural confluent calculus for concurrent constraint programs, if the syntactic domain is extended by a blind choice operator and a special constant standing for a discarded branch. This has application to program analysis. 1 Introduction Concurrent constraint programming (ccp) [16, 15] is a recent programmingparadigm which elegantly combines logical concepts and concurrency mechanisms. The computational model of ccp is based on the notion of a constraint system, which consists of a set of constraints and an entailment relation. Processes interact through a common store. Commun..
Degrees of Separation: A Flexible Type System for Data Race Prevention
Data race is a notorious problem in parallel programming. There has been
great research interest in type systems that statically prevent data races.
Despite the progress in the safety and usability of these systems, lots of
existing approaches enforce strict anti-aliasing principles to prevent data
races. The adoption of them is often intrusive, in the sense that it
invalidates common programming patterns and requires paradigm shifts. We
propose Capture Separation Calculus (System CSC), a calculus based on Capture
Calculus (System CC<:box), that achieves static data race freedom while being
non-intrusive. It allows aliasing in general to permit common programming
patterns, but tracks aliasing and controls them when that is necessary to
prevent data races. We study the formal properties of System CSC by
establishing its type safety and data race freedom. Notably, we establish the
data race freedom property by proving the confluence of its reduction
semantics. To validate the usability of the calculus, we implement it as an
extension to the Scala 3 compiler, and use it to type-check the examples
- ā¦