[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rather, DSSLs increase modularity, productivity

On Tuesday, November 18, 2003, at 12:52 PM, Neelakantan Krishnaswami 

> Matthias Felleisen writes:
>> On Monday, November 17, 2003, at 11:34 PM, Neelakantan Krishnaswami
>> wrote:
>>> IIUC, the type system for Java generics ensures that a type-safe Java
>>> 1.5 program will never throw a casting exception at runtime.
>> With all respect, but I doubt that one. Not even ML can do this.
> I'm only talking about Java's ClassCastException, not other kinds of
> errors, such as the RuntimeStoreException that Java's covariant arrays
> permit.
> Incidentally, I don't understand your point about ML: it doesn't have
> a cast operator, so it seems like it's vacuously the case that it can
> never fail a cast.

So what's pattern matching? It's a cast from a type to a variant. And 
it can
fail if you don't specify enough patterns.

Ditto for array indexing. That;'s a cast from array to indexed array. 
And it
can fail.

Just because Milner said typed programs can't go wrong doesn't mean
he was right :-) He overlooked way too many cases, which is why Andrew
and I rewrote type soundness.

-- Matthias