Hacker News new | ask | show | jobs
by raoof 696 days ago
the language is obviously (at least to me) turing-complete in the limit of the program length. even if you don't buy my argument that it is also turing-complete without the limit notice that in ordinary programming you never need a function that is valid on all input because actual computers have time and memory limitation
1 comments

I must just be missing something then. How would you write a program that prints out the numbers from 1 to n, for reasonable n? (representable by a computer)
I think the issue here is that the language doesn't have any form of user input, so all possible programs are fully static and thus can be represented without any loops or conditionals.

I don't agree that the language is turning complete due to the lack of any runtime dynamic aspect of the language.

It's akin to compiling a simple c program with loops unrolled and fully static variables and claiming the subset of generated assembly is turning complete.

Agreed.

> It's akin to compiling a simple c program with loops unrolled and fully static variables

Yes, and optimizing compilers take this to an extreme. It turns out that "computing" a factorial only requires my runtime language to have `mov` and `ret` instructions: https://godbolt.org/z/3Y6bGcsba

in my model it's the platform job to handle the user input and your program output you just write your function and the platform calls your program for example f(time,input_data,key_a,key_b,key_c,...) . if you are very very patient and don't care about the program length you can just compute every output of your program for every possible input. according to [this](https://web.archive.org/web/20230505022436/http://page.mi.fu...) paper a single loop and four basic arithmetic operation is enough to simulate a turing machine so my idea was that to unroll the loop and my conjecture is that we don't need the loop and only four operations is enough to compute all total computable functions
(now I can reply here, let me repeat it again) it depend how you want to display the result to the user, you can just compute a number that represent an html page showing the numbers from 1 to n
The question isn't as to how it will be represented, that's the boring part.

When given a number n, and you want to display them, how will you actually compute the numbers from 1 to n? If you precalculate a table - then how will you do n+1? What about n+2?

it takes a lot of time and patient to come up with a function that works for all n and also have a short length, let me try if I can solve this problem it may takes a few hours or days or maybe months I'll post the solution here so stay tuned. but if you want to make your life easier you can generate the function in a meta language so you can always be sure that your software does not have a halting problem