2 ms·
If the compiler is part of the runtime (i.e. an interpreter that compiles expressions in order to evaluate them), and then the type checker is part of the compi
by derefr 17y ago
If the compiler is part of the runtime (i.e. an interpreter that compiles expressions in order to evaluate them), and then the type checker is part of the compiler, even eval should be able to throw type errors. What, then, is the problem?
- baguasquirrel 17y agoIt's not a statically typed language like Haskell anymore?
- fauigerzigerk 17y agoThe problem is that the type error occurs at runtime, which is exactly what static type checking is supposed to prevent in the first place.
- derefr 17y agoIt depends on what you mean by "runtime." If you're creating a new datatype, is that really "at runtime," or are you just talking to the compiler interactively? To put it another way: metaprogramming might have effects at runtime, but not the kind of effects that change depending on what the runtime does. Metaprogramming should be deterministic for your program to be considered to be "in production."