-
Notifications
You must be signed in to change notification settings - Fork 0
/
esop-abstract.tex
49 lines (44 loc) · 2.16 KB
/
esop-abstract.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
\either{\chapternobreak{Abstract}}{\chapter{Abstract}}
Typed Clojure is an optional type system for Clojure, a dynamic
language in the Lisp family that targets the JVM. Typed Clojure
enables Clojure programmers to gain greater confidence in the
correctness of their code via static type checking while remaining in
the Clojure world, and has acquired significant adoption in the
Clojure community. Typed Clojure repurposes Typed Racket's
\emph{occurrence typing}, an approach to statically reasoning about
predicate tests, and also includes several new type system features to
handle existing Clojure idioms.
In this part, we describe Typed Clojure and present these type system
extensions, focusing on three features widely used in Clojure.
%
First, multimethods provide extensible
operations, and their Clojure semantics turns out to have a surprising
synergy with the underlying occurrence typing framework.
%
Second, Java
interoperability is central to Clojure's mission but introduces
challenges such as ubiquitous \texttt{null}; Typed Clojure handles
Java interoperability while ensuring the absence of null-pointer
exceptions in typed programs.
%
Third, Clojure programmers
idiomatically use immutable dictionaries for data structures; Typed
Clojure handles this with multiple forms of
heterogeneous dictionary types.
%
We provide a formal model of the Typed Clojure type system
incorporating these and other features, with a proof of
soundness. Additionally, Typed Clojure is now in use by numerous
corporations and developers working with Clojure, and we present
a quantitative analysis on the use of type system features
in two substantial code bases.
%% Clojure is a dynamically typed language hosted on the Java
%% Virtual Machine.
%% Typed Racket is a valuable starting point for
%% a gradual type system that targets Clojure.
%% Building a similar type system for a new language gives the
%% designer some flexibility to repurpose and extend features.
%% This paper gives an overview of Typed Clojure, concentrating
%% on the extensions and differences from Typed Racket. We also
%% show where Typed Racket's features were particularly useful
%% for type checking non-trivial Clojure idioms.