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

Re: Rather, DSSLs increase modularity, productivity




On Tuesday, November 18, 2003, at 09:36 PM, Evan Martin wrote:

> On Tue, Nov 18, 2003 at 08:50:30PM -0500, Matthias Felleisen wrote:
>>> 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.
>
> As I understand it: the important difference is that with ML-style 
> pattern
> matching, the set of possibilities is known at compile time.  It's not
> only bad form to not match all possible cases-- it's a compiler 
> warning.
> This is both convenient (no more run-time errors from "casts") and a
> limitation (you must fully define the set of possible types).

1. Whether or not you define all patterns or not is immaterial. When you
go from

  t = A | B

to A, you cast. Like it or not.

2. So what's a warning/sharning? Is it an error or not?

3. Have you ever seen "uncaught exception" from unison?
Authored by Benli himself? Great tool. Use it every day,
despite such impossible run-time errors :-) I wish I had kept
the screen shots.

4. And how about array width checks? Are they also impossible?
I know I know. We can use a Martin Per Loef type theory to get
around that, too. (Oh, did I forget to say that decidable type checking
isn't useful.)

-- Matthias, who advocates the use of types to LL1ers.