1,156 karma · joined April 12, 2019
Have you seen idiomatic Rust codebases? Even the macros have macros. It's sheer bliss. "Fheiq kah, puom," as they say.
Let's assume 15 floors since otherwise you'd probably save time walking.
The article suggests a grid efficiency of 50% and a motor efficiency of electric e-bike motors as 75%. It looks like elevator motors are actually more efficient (increasingly so as more people are loaded) [4]. It's only about 5 percentage points higher, so for simplicity let's keep 75%.
Ignoring the transportation and manufacture cost of the elevator assembly (not totally unreasonable since it has a long lifetime), elevators have an energy ratio of 2.5:6.7 or 1:2.7, which looks far better than the 1:28 that the article quotes for humans.
Gee, that kind of upends my worldview... I guess I'll just wait until bodies are deprecated in favor of high-efficiency cybernetics.
[0] https://captaincalculator.com/health/calorie/calories-burned...
[1] https://www.livestrong.com/article/301539-calories-burned-cl...
[2] https://www.quora.com/How-much-electricity-does-an-elevator-...
[3] https://fatknowledge.blogspot.com/2007/02/how-much-energy-do...
[4] https://www.me.ua.edu/me416/LECTURE%20MATERIALS/MotorEffic&P...
[0] https://www.intel.com/content/www/us/en/security-center/advi...
I have a morbid, but sneaking suspicion that that it's the latter half of "live fast, die young." Maybe I'm just projecting, though ;)
* cargo-expand [0]: dumps the expansion of troublesome macros
* cargo-bloat [1]: explains why a package is so huge
* ripgrep [2]: RIP grep
* llvm-tools-preview (via [3]): the LLVM tools with which Rust was compiled (because LLVM versions sometimes don't interoperate)
[0] https://crates.io/crates/cargo-expand [1] https://crates.io/crates/cargo-bloat [2] https://crates.io/crates/ripgrep [3] https://crates.io/crates/cargo-binutils
What? You mean keto practitioners aren't following a strict vegan diet of avocados and processed soy protein? /s
More seriously, though, in fewer than 20 years, meat substitutes will be ubiquitous and people will tend towards sun-fed burgers (if for no reason other than cost).
Two questions for you:
1. How does performance look for private ERC20-type contracts? zkSNARKS can be rather heavy to compute, so would that affect scalability?
2. Is it possible to do cross-contract calls without knowing the recipient's private state? How does one construct a proof for a new state without knowing the original state?
If you don't want to pull in musl or a traditional libc, there's a more Wasm-y solution known as the Web Assembly System Interface (WASI) [0] that delegates the libc functionality to the runtime.
A WASI Wasm module can be compiled using clang, as in the article. The only difference is to use the WASI sysroot [1].
> optimization
LTO and -O3 are great! I've also found the Twiggy [2] tool useful for more "manual" optimization.
[0] https://wasi.dev [1] https://github.com/CraneStation/wasi-sdk/releases [2] https://rustwasm.github.io/twiggy/
Also, soybeans are more efficient than lentils and white beans are more versatile (e.g., https://github.com/nhynes/pbean)
It looks a lot like how a command-line program has the program name as the zeroth argument. The address just happens to be the name of the program in a blockchain context.
> exposing the blockchain interface as a module feels like it would be a significantly cleaner implementation
I'm not so sure. I think that the goal here is to allow developers to program "DApps" using their normal toolchain and abstract over the semantics of the blockchain platform. IMHO even the ideas of "block" and "chain" are implementation details in the same way as the journal of a traditional database is an implementation detail. Exposing these details as a library means that the program is tied to not only the blockchain, but a particular blockchain runtime.
> wrap that module as a library behind my own interface
That's always a good idea, but not incompatible with having a lower-level interface (in this case WASI and Rust/C++/AsmScript `std`).