151 points · by karldray · 10y ago · 51 comments
[0] BTW, it's annoying to read a book by a Swedish author, in Swedish, that has translation issues. The author is Swedish-American, so the book was written in English and translated by someone else.
https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-28.htm...
This library is significantly less useful than amb for non-deterministic computing, but that doesn't seem to be the goal...
The quantum example is interesting because it gives us a sneak peek into the future for where it will be possible to write similar code in O(1) time!!
For quantum suicide (as in https://en.wikipedia.org/wiki/Quantum_suicide_and_immortalit...) - it still makes me think. Maybe it makes sense to gamble with others (using photons in superposition), putting my life at stake. And e.g. in the only 1/1024 universes I live I have x1024 money (and other universes do not matter to me).
The lower the probability of winning a bet (and so, the higher the potential gain), the more reliable you need your suicide system to be. For relevant gains, this becomes a non-trivial engineering problem. (e.g. suppose you need a gun that only jams for one in every billion shots, or a computer that can run for billions of seconds without crashing or malfunctioning).
So why there may be problems (like: photon was not detected due to finite sensitivity) in this setting the wounded-but-not-dead outcome is negligible. In general, it is easy to amplify quantum effect with such avalanche reactions.
When it comes to MWI - it is the hard part. I am not sure if I believe it; or what is it's interpretations (maybe it's still unethical to having mourning families and friends in 1-\epsilon worlds). Also: even if I gamble many times, and I find myself alive - does it mean is it correct? And even if - there is no way of announcing it.
And also, on a funnier note - Everettian dating: https://www.youtube.com/watch?v=vBkBS4O3yvY
For the reasons it seems that it is good to be brave in danger - for all brave succeed. Except for ones that did not and won't tell their stories.
I will check out later the code
HOWEVER simple and easy solutions often are better, so based on the same simple idea the same experiment could be reimplemented with green threads and separate/cloned python environments in order to ensure that there is no shared memory.
In my opinion it is still a genius work, just missing compiler support for such construct.
A really simple example would be something like logpy [1]. You give it a set of variables, and a set of constraints, and it will try to efficiently solve for values that meet all the constraints.
A more professional-grade logic solver might be Clojure's core.logic [2], which has been used in many real-world applications. Compare the core.logic Sudoku solver [3] with the quantum version. They are similar, in that they each set the constraints for a solved board, but core.logic is vastly, vastly more efficient.
[1] https://github.com/logpy/logpy [2] https://github.com/swannodette/logic-tutorial [3] https://gist.github.com/swannodette/3217582
r = qrandom()
print(r)
wait(10 minutes)
if(EUR/USD != r) then fail()
will predict, what exchange rate of EUR/USD would be after 10 minutes. And if instead of r = qrandom() we put r = 1.5, than we force EUR/USD to be 1.5. Another nice thing I'd like to try is webcam that looks to the future using the same principle :)
Didn't get what does the exit code 55 mean though.
Incidentally, that sounds like a great idea for a novel!
Immediate edit: So on a lark I looked up "tilde ath" and found someone actually implemented some of it [0]. It's more focused on bifurcation than threading, and I think it might be improved by something like OP's `quantum`. At least we could simulate the plot a bit.