3 ms·
Is it catching the type error before executing the code with the type error? The technique presented by the authors does not wait until there's a type mismatch
by scott_s 11y ago
Is it catching the type error before executing the code with the type error? The technique presented by the authors does not wait until there's a type mismatch in an individual expression inside of a function. It catches the type mismatch before executing the function. That's what they mean by "just-in-time static". It happens "just-in-time" because it's during program execution, but it's "static" because it happens before executing the function itself.
- junke 11y agoYes, during compilation. (defun foo (x) (compile () `(lambda (u) (print "Executed") (aref ,x u)))) (foo 0) ... reports a compilation error and of course does not print anything. If however I directly type the offending form (aref 0 0) a runtime type error is signaled.
- scott_s 11y agoI believe that is still quite different from the technique presented by the authors. Their technique applies at program execution, but prior to the execution of the individual functions. What you're showing is all prior to program execution.
- TeMPOraL 11y agoNo, this is during program execution. Lisps blend compile time and run time together. You always have a compiler available, so you can compile new stuff (and recompile existing stuff) in the middle of your program's execution. And compile-time typechecking occurs whenever you compile.
- junke 11y agoThe type analysis happens only after I enter "(foo 0)" in the REPL, which is execution time.