Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Mar 2020 19:24:29 -0400
From:      Aryeh Friedman <aryeh.friedman@gmail.com>
To:        Pete Wright <pete@nomadlogic.org>
Cc:        "Steve O'Hara-Smith" <steve@sohara.org>, FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: NodeJS on FreeBSD
Message-ID:  <CAGBxaXntwocj0cDTH8%2Bbs3ooQczKDtCCvDqLiWv7tPRGc9KwjA@mail.gmail.com>
In-Reply-To: <75a140b8-b1bb-6f0f-8c82-f1919b94d599@nomadlogic.org>
References:  <20200321044044.3p3jjdzedd3nkkuq@sea-ll-10936> <6742b7b7-67fc-a8d1-c7d4-c259f3c41f3c@nomadlogic.org> <20200323201527.yeae67icceifel6d@sea-ll-10936> <CAGBxaXmh3dsh6eyLobaYUEH1bdSnUGAd1RpPZb%2Bg_zqjAQkXKA@mail.gmail.com> <20200323222055.d785bbabbeb613661d30ca80@sohara.org> <75a140b8-b1bb-6f0f-8c82-f1919b94d599@nomadlogic.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 23, 2020 at 6:31 PM Pete Wright <pete@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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGBxaXntwocj0cDTH8%2Bbs3ooQczKDtCCvDqLiWv7tPRGc9KwjA>