
The Many-Worlds Interpretation of JavaScript - hachibu
https://hachibu.net/posts/2020/the-many-worlds-interpretation-of-javascript/
======
hachibu
Author here. Thanks for educating me on the subtleties. It seems like I was
mixing up a Level 3 multiverse with a Level 2. I made a small edit to remove
the sentence about constants changing. And I also added a note that I edited
the post.

------
lalaithion
> The many-worlds interpretation of quantum mechanics imagines our universe as
> one node in an infinitely branching tree of universes where every possible
> quantum outcome exists in its own universe. And each time a universe
> branches, it creates a child universe that is slightly different from the
> parent universe, e.g., universal constants such as gravity and the speed of
> light might differ.

Pretty sure this is flat out wrong; the Many Worlds hypothesis does not
include universes in which universal constants differ.

~~~
hachibu
Author here. Sorry, I guess I misunderstood that part of the hypothesis. Do
you have a source, so I can edit my post and correct it?

~~~
AgentME
It seems you're mixing up MWI with a Max Tegmark Level II multiverse:
[https://en.wikipedia.org/wiki/Multiverse#Level_II:_Universes...](https://en.wikipedia.org/wiki/Multiverse#Level_II:_Universes_with_different_physical_constants).
Tegmark considered MWI a separate idea from that and used the label "Level
III" for it.

MWI is just one of multiple multiverse ideas. Most multiverse ideas (like
Tegmark's Levels I, II, and IV) are basically what-if ideas without any direct
evidence, but MWI specifically happens to be a more-grounded idea based on
trying to make sense of what the (well-tested) Schrodinger equation says about
reality.

The first part of your description of MWI ("The many-worlds interpretation of
quantum mechanics imagines our universe as one node in an infinitely branching
tree of universes where every possible quantum outcome exists in its own
universe.") is pretty good, if a slight though common simplification
(different branches aren't entirely separate, so envisioning it as a tree is
only mostly correct; different branches can sum together or cancel each other
out if their configurations are identical).

~~~
codethief
> trying to make sense of what the (well-tested) Schrodinger equation says
> about reality.

Nitpick: The Schrödinger equation predicts unitary time evolution (which is
another way of saying that physical systems evolve in a deterministic manner).
Interpretations of quantum mechanics exist to make sense of the part of
quantum mechanics that _doesn 't_ follow unitary time evolution, namely the
measurement process.

------
AgentME
This idea seems like it might be useful for anonymizing code.

------
fennecfoxen
> According to the many-worlds interpretation of quantum mechanics, your
> universe branched into many universes the moment you decided to use a for-
> loop. In this universe you wrote a for-loop, but in another universe you
> wrote a while-loop.

Nonsense. If universes branch into many other universes, they do so when an
event on the quantum level needs to be resolved. I presume that during any
single decision-making operation, there are trillions of probabilistic quantum
events took place in your brain, but your decision to use the for loop was
_almost certainly_ fully deterministic, because at this point in time you
personally almost always pick for-loops.

~~~
fastball
I was actually delighted to discover that I've matured (ossified?) enough as a
programmer that my source code is in fact fairly deterministic: the other day
I somehow managed to completely wipe a fairly complex function (100+ LoC) from
my repo before I committed it. I did this a week or so after I initially wrote
the function. I then rewrote the function from scratch, with very little
memory of how I wrote it the first time, just knowledge of what it needed to
do. Ironically enough, almost as soon as I finished writing this function, I
found a copy of the original one that I'd somehow stashed and forgotten about,
and the two functions were literally identical.

~~~
ChristianBundy
Interesting, I've noticed the exact opposite. For me, rewriting a program
produces a slightly different program with different trade-offs. It's rare to
have the time to build a bunch of different implementations of the same code,
but when I have time it results in code that I'm very happy with.

------
thrower123
I sort of wish I could trade places with the version of me in the universe
where Flash wasn't murdered.

~~~
TedDoesntTalk
You liked flash programming??

~~~
thrower123
I think I would appreciate it now, and the JavaScript that replaced it is
really horrible. We haven't really gained any ground in about fifteen years,
in real terms, there's just been a lot of swirling.

Even WebAssembly's best case scenario is... Java Applets done a smidgeon
better.

~~~
krapp
WebAssembly's best case scenario is "native software compiled to run to the
web." Unlike Java applets, WebAssembly isn't tied to a specific language or
runtime, so that "smidge" in the case of being inclusive of so many languages
is pretty big.

You could even run Flash sites in WebAssembly, the only thing stopping that
from happening is copyright law. It would probably be even safer and run
faster than Adobe's plugin.

~~~
thrower123
Or you could just run native software...

I dunno, I don't get the point. If it gets rid of the dumpster fire that is JS
applications, good, but it'd be better if the web could be for documents and
applications could be for applications.

I'm too cynical and I've seen too much to believe that it'll be silver bullets
and rainbows.

The write-once, run-everywhere idea always falls down, and pushes everything
to lowest common denominator shovel-ware.

~~~
krapp
>but it'd be better if the web could be for documents and applications could
be for applications.

I disagree. Being able to compile software in practically any language and
have it run both natively (because native runtimes for WebAssembly do exist)
and in a browser would revolutionize the way people access software.

I mean, someone wrote Pong in COBOL[0] and I can run it in a browser without
having to find a COBOL runtime for Windows 10. That's pretty damn cool, and
it's significantly better than what Java and Flash could provide for both
developers and the end user.

[0][https://news.ycombinator.com/item?id=23189918](https://news.ycombinator.com/item?id=23189918)

------
tiborsaas
This is art, I love it.

------
holoduke
It's funny that there is such a pro and anti js movement in the hardcore
professional programming world. I know it's a bit off topic. But in every js
topic here at hackernews you can feel this tension. I have never seen this
before. And this place is visited by the best programmers out there . Very
interesting

~~~
jacobr1
Here is my theory: it is a limitation of the medium of the web. In other
software fields, one can use the tooling they like. But with the browser, JS
is a must (nascent webasm may change that though). The Go people don't really
fight the Rust folks, they just go off to their own camps, occasionally
comparing and contrasting. But in the web/js world, everyone is forced to
commingled, and so preferences collide.

