Tiring completeness of EVM
I hear often that the Ethereum virtual Machine is Turing complete and so you can simulate essentially any computation on it.
This got me wondering. How do I sort n numbers using EVM? One obvious thing to do is to set up a smart contact. Any address can send a sequence of transactions to the contract and when the smart contact receives a particular transaction (say of 0 eth) from the calling but address, it sends back all previously received eth from it in sorted order (by transaction value).
This seems incredibly stupid but at least there is a way to perform the computation.
Is there a more reasonable/clever way?
I suppose i am primarily struggling with coming up with a decent way to enter input and read output from EVM. Encoding inputs as values of eth in transactions sent to smart contacts clearly works only in theory.
Does someone have a link to any article discussing the Turing completeness of EVM. Any fun projects exploring this aspect (and not about making money or adding useful features)? I want some pointless and fun project!
submitted by /u/dies_und_dass
[link] [comments]