archives

(newbie question) Covariance and contravariance

Firstly I don't have any theoretical background in Category Theory. My goal is just trying to understand the following:-

On wikipedia,
there is the following definition:

A covariant type operator in a type system preserves the ordering ≤ of types. 
A contravariant operator reverses ≤. If neither of these apply, the operator 
is invariant. These terms come from category theory.

What is type operator referring to in the context say Java ?
The entry goes on to say:

The array type is usually covariant on the base type.

Would I be right to say that the type operator is the assignment operator ?
e.g.

String[] a = new String[1];
Object[] b = a;

Thanks.

Featherweight JavaScript?

I am looking for a calculus representing the core features of JavaScript (ECMAScript), in the same way as Featherweight Java calculus does that for Java.
Unfortunately, the only calculus I was able to find is JS0T described in Towards Type Inference for JavaScript.
A quick glance made me suspicious to the faithfulness of JS0T in respect to JavaScript, as for example, objects are typed as recursive records. While this is a common approach in OO calculi, I believe using it for JavaScript is unjustified - to my knowledge, "this" is defined dynamically, not lexically, so to speak.

Could anyone please point me to the right direction (either by providing references, or by negating my suspicion)?

Thanks a lot!

The Land of the Terminal

A Cautionary Tale

An essay I wrote involving the use of text in programming languages. The fact that subtext was just recently mentioned here is actually a coincidence, but I'll take it.

Comments?