Evolutionary Programming and Gradual Typing in ECMAScript 4

Evolutionary Programming and Gradual Typing in ECMAScript 4, by Lars T Hansen, Adobe Systems, is an 18 page tutorial detailing features of ECMAScript 4, and how they can be applied to existing ECMAScript code to improve it.

This tutorial uses a simple library as a running example to illustrate the evolution of a program from the ES3 "script" stage, via various levels of typing and rigor, to an ES4 package with greater guarantees of integrity and better performance potential than the original code. We then look at how union types, generic functions, and reflection can be used to work with a library whose code we can't modify.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

isLikeType method and like operator

I have never seen a type comparison based on 'like' or isLikeType, as this paper shows. Are there any other languages where this is available? Or was this created for ECMAScript 4?