That this type checker is written entirely in OCaml is no coincidence.
It should not be surprising that Scala, like OCaml, was developed by academics, has a powerful type system, and prizes correctness and performance even at the expense of the individual programmers' freedom and delight in their craft.
Table I gives timings for the analysis of various small to medium-sized OCaml programs.
(4) This might cause performance problems in a conjunction with OCaml objects, which relies intensively on type abbreviations to make type expressions more manageable [Remy and Vouillon 1998].
variable constructor comparison instantiation instantiation instantiation CamlTk 13.1 28.9 1.2 Coq 38.8 32.1 2.1 Ensemble 19.1 16.0 2.4 MMM 14.8 20.4 1.4 OCaml Libs 13.7 9.5 5.2 OCaml Progs 16.9 9.8 1.9 To highlight the impact of including or eliding type annotations associated with various language features, we express our results (here and in the tables that follow) as numbers of occurrences per hundred lines of code.
anonymous functions CamlTk 2.9 Coq 12.4 Ensemble 2.4 MMM 2.8 OCaml Libs 0.7 OCaml Progs 3.1 We see that the usage of anonymous functions varies according to programming style: the Objective Carol libraries use almost none, preferring direct recursive definitions, while application programs tend to make reasonably frequent use of higher-order functions like map and fold.
local top-level other functions functions let-bindings CamlTk 0.5 7.5 8.7 Coq 1.5 7.0 10.5 Ensemble 2.8 4.2 9.6 MMM 1.0 3.8 8.8 OCaml Libs 0.6 8.7 7.9 OCaml Progs 0.5 3.9 6.9 Let-bindings are fairly frequent, as might be expected.