5 ms·
If you have some form of Turing-complete macros, then macro processing might not terminate. I don't see why this is anything but trivial, or a compelling argume
by kps 6y ago
If you have some form of Turing-complete macros, then macro processing might not terminate. I don't see why this is anything but trivial, or a compelling argument against Turing-complete macros.
- tlb 6y agoI don't think it's a compelling argument against having such a language. But you might want to know what you're up against if, say, you decide to write an autocompleter for your editor that needs to know types.
- gpm 6y agoIf you're writing an autocompleter, you have the bigger problem that it has to function when the program isn't valid syntax, or is valid syntax but has just plain contradictory type information and doesn't typecheck. Non-terminating typechecking seems easy to handle in comparison.
- minerjoe 6y agoIn lisp and in other languages you just ask the running process.
- greggman3 6y agoBecause turing complete macros are super powerful. See lisp
- jolux 6y agoThis page isn't arguing against anything though.
- orthoxerox 6y agoA Turing-incomplete macro system will always terminate, but it may terminate in 2 years.
- curryhoward 6y agoThat's true in practice, but technically speaking it's false. You could imagine a contrived system which is not Turing complete but still contains a (rather useless) primitive that causes an infinite loop.
- leni536 6y agoNon-Turing complete doesn't mean that you can't create too high complexity algorithms out of O(1) primitives.
- curryhoward 6y agoDid you mean to reply to a different comment? You seem to be restating the correct part of orthoxerox's comment. I was merely refuting the incorrect part.
- joshuamorton 6y agoArguably that would still terminate with an error message.
- TheCoelacanth 6y agoI don't think a Turing-incomplete language implies that programs always terminate. As a counter-example, imagine an obviously Turing-incomplete language that contains only a single instruction which simply does nothing in an infinite loop.