NodeJS on FreeBSD

Aryeh Friedman aryeh.friedman at gmail.com
Mon Mar 23 23:24:42 UTC 2020


On Mon, Mar 23, 2020 at 6:31 PM Pete Wright <pete at nomadlogic.org> wrote:

>
>
> On 3/23/20 3:20 PM, Steve O'Hara-Smith wrote:
> > On Mon, 23 Mar 2020 17:55:23 -0400
> > Aryeh Friedman <aryeh.friedman at gmail.com> wrote:
> >
> >> IMO JS is not even fully Turing complete!
> >       It's as Turing complete as any language (limited by resources).
> > There's even a PC emulator that can boot Linux written in JavaScript
> which
> > is a pretty good demonstration of completeness.
> >
> not to extend this bikeshed any more but don't forget netbsd's did
> something similar in 2012 or so :)
>
> https://blog.netbsd.org/tnf/entry/kernel_drivers_compiled_to_javascript
>

Find me a UTM that randomly turns on without human intervention after
HALT'ed and then explain to me why it qualifies as a UTM.   Just because it
can run a tape through and if the tape's instruction complete in a finite
of time (or infinite amount of time depending on the instructions) it stops
that tape does not make it a  UTM that can be used to the answer the
halting problem (it has to stay halted for the question to even be
meaningful).

In JS terms here is a statement that makes the halting problem meaningless
at best and impossible to even ask about decidablity on:

function func()
{
             setTimeout(func,Math.random()*10000000);

             // do the rest of the program we are attempting to decide on

             HALT
}

Due to how JS VM's work the program (aka the tape we are asking the halting
problem of) will pause for a random amount of time (which may or may not be
long enough to allow the rest of the program to complete if it is finite
runtime).   The tape *DOES NOT* know it has been paused and/or run multiple
times.   Therefor the entire question of does it HALT or not can not be
answered by looking at the tape alone without knowing stuff that only an
oracle (the machine running the tape) could answer.   Thus JS is not Turing
complete. QED.

Disclaimer: Just because I am forced to use this monstrosity in browser
apps does not mean it is not monstrosity

-- 
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org


More information about the freebsd-questions mailing list