2 ms·
Lisp is also undecidable simply because the body of a (defmacro ...) form can do anything, including getting into a loop and not terminating. Programming in ge
by kazinator 9y ago
Lisp is also undecidable simply because the body of a (defmacro ...) form can do anything, including getting into a loop and not terminating.
Programming in general is undecidable even if the compiling of the language isn't. Whether or not a program gets to the executable stage may be decidable in some language, but whether that program terminates and calculates the correct result isn't. (So what good is the first order decidability, at the end of the day.)
In practice, building everyday, run of the mill programs terminates in a reasonable time. The undecidability means that the time isn't guaranteed; we must be prepared to wait arbitrarily long for a compilation, and to forcibly terminate it it we feel that it seems like it won't complete. And when we do that, we have no proof that it wouldn't have completed. But, so what; if a file that should take seconds to compile takes 15 minutes (i.e. that particular case is decidable), we still regard that as a problem. Why on Earth is it taking 15 minutes? Either something is wrong, or we have to adjust our expectation for that file.
- msla 9y agoI will say that Lisp macros are more obviously undecidable than some of the other things here, because they're obviously arbitrary Lisp code. It isn't a surprise when someone says that a Lisp function could loop forever.