On Monday, 29 July 2013 at 11:46:05 UTC, Leandro Motta Barros
wrote:
This may be off topic, but here I go anyway...
Back in the school days, I joked that the Halting Problem is
actually
easy to solve with a Turing Machine. Since a Turing Machine is a
theoretical device that exists only in our imagination, we can
just
suppose that it is infinitely fast. So, we simply have to load
our
program in the machine and run it. If the machine doesn't stop
immediately, it means that it will run forever.
And what does this have to do with DMD?
Well, I kinda have the same feeling when using it. For my
~10kloc
project, I still haven't felt a real need to use a real build
system.
I just dmd *.d. If any measurable time passes without any error
message appearing in the console, I know that my compiled
successfully
(and it is the linker that is running now).
BTW, 10kloc is not such a large codebase, but this is with DMD
2.063
anyhow, before those improvents ;-)
LMB
The halting problem isn't about something taking an infinite
amount of time but about the decidability of it.
For example, we can write a program that will take forever but if
it is known to do so and will never halt, then there is nothing
special about it.
For example, for(;;); in an infinite loop and will never
halt(except when you turn the power off ;) but it's halting state
is completely known.
Halting problems are much more complex.
Even something like
for(;;)
{
if (random() == 3) break;
}
is decidable(it will halt after some time).
I would write a program that is undecidable but the margin is too
short! ;)