Oleg has an interesting piece that I haven't found mentioned on LtU (though it dates from 2000):
Blending static and dynamic typing: Scheme programming in ML
We show several examples of writing ML (OCaml) code in the style of Scheme programs, taking the fullest advantage of latent typing and placing no type annotations. The ML code features:
- intentionally polymorphic functions: Scheme display
- lists of variously intentionally typed elements
- functions with a variable number of polymorphic arguments: *
- self-application combinator
- higher-order polyvariadic intensionally polymorphic function: Scheme for-each
[...]
The code is trivial -- and that is the point. Defining and using the Universal type in a statically typed language is indeed embarrassingly easy. The code has not a single type annotation, and looks as dynamically typed as Scheme code. The source language is still OCaml, with static typing present and available to the programmer. Thus ML offers a blend of dynamic and static type programming; it's a programmer who chooses the proportions of this blend.
(disclaimer: I'm not posting this to start another religious battle, but as an interesting example)
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 19 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago