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

Re: Rather, DSSLs increase modularity, productivity



At Mon, 17 Nov 2003 23:44:49 -0500, "Felix Klock's ll1 list proxy" wrote:
> 
> My impression, from back when I actively followed polyJ, Pizza, GJ,  
> NextGen, etc:
> The compiler statically verifies that the computation is well-typed.
> 
> What I suspect Christopher is referring to is the fact that the output  
> bytecode still has dynamic checks that it runs, since the generated  
> bytecode is backward compatible with pre GJ VMs, and so it does have to  
> continue to pass the runtime bytecode verifier.
> 
> So you still have the same runtime inefficiency; the main plus (but the  
> more important one IMO) is that you know at compile-time that things  
> won't go wrong with respect to type-casts.

Indeed, that is the whole point! Writing "the compiler just generates
the checks for you" is wrong. The compiler also guarantees that certain
kinds of casting errors never happen at runtime, which means the
programmers can rely on the type system to enforce invariants for them.
If the compiler were "just" generating runtime casts, it wouldn't be
(generic) polymorphism at all!

Robby