Can a programming language be written that makes it impossible to write invalid code and be expressive?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sun Jul 28 07:30:02 UTC 2019


On Sunday, 28 July 2019 at 04:58:40 UTC, Ike wrote:
> Pure languages also sort of work along these lines as as they 
> do focus on the input's more by restricting the inputs to be 
> well localized.

Do you mean purely functional languages? You certainly can get 
runtime-issues in those, like infinite recursion. Also, the 
execution matters, if you get you have "f(x) AND g(x)" where f(x) 
enters infinite recursion and g(x) resolves to false, then the 
program can complete if g(x) is resolved first, or if both f(x) 
and g(x) are resolved concurrently and the runtime system is able 
to abort the execution of f(x).

Anyway, the key point of the halting problem is that this 
situation cannot be avoided unless you restrict the space of 
problems that can be solved.

https://en.wikipedia.org/wiki/Halting_problem





More information about the Digitalmars-d mailing list