ext_83566 ([identity profile] pozorvlak.livejournal.com) wrote in [personal profile] pozorvlak 2008-04-01 10:25 am (UTC)

Re: I don't know about that

Well, TH does all its transformation at compile-time, and the output is fed to the type-checker then and there: if your macro produces ill-typed code, you learn about it quickly. Whereas in Lisp, as I understand it, macros can be invoked at runtime, causing type errors while the program's actually running.

I remember reading somewhere that some well-known theorem, possibly Rice's Theorem (http://en.wikipedia.org/wiki/Rice's_Theorem), implies that
  • it's impossible to write a static type system that catches all bugs;
  • the stronger you make your type system, the more valid code will be rejected.
. Hence the perfect static type system you want is actually impossible. It also seems to be the case that inference imposes a large cost on a type system: if you want your compiler to infer types, you're greatly limited in the features your type system can offer.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting