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

Re: Rather, DSSLs increase modularity, productivity



Shriram Krishnamurthi wrote:

>>		     Type declarations are optional in Curl, but when you 
>>do declare them the compiler will check types statically and will 
>>generate better code based on what it knows about the type.
>>    
>>
>
>If I pass the values in type-annotated variables to un-annotated
>functions, how will Curl "check types statically" (or what does this
>even mean)?
>  
>
Unannotated variables or parameters have the static abstract type 'any' 
(which could also be declared explicitly), which is the supertype of all 
types in Curl.  The compiler does check for type compatibility, but 
since all types are compatible with any, the check will never fail.  The 
compiler is only going to be able to generate better code if the static 
type is narrower than 'any'.

- Christopher