Thank you. I must say that this is the ONLY white paper I managed to understand, ever. Very concise. Kudos to the authors. I wish we had more like this.
"For a limited time, you can buy any Git commit from this repository as a Non-Fungible Token on my Content-First Multimedia Proof-of-Authority revision-controlled realtime collaborative private enterprise blockchain (a shared Google Doc)."
This is one of the most subtley funny things I’ve ever seen on H.N, specifically because the target audience is so small. You have to understand both C++ memory management and what an NFT is.
Wow, I thought for sure it was a punchline, but no:
> written in rust for the hipster cred.
I'm probably a founding member of the Rust Evangelism Strike Force but stuff like this seems ... way overboard. Almost like a Poe's Law demonstration - it's hard to determine whether it's satire or not.
These are my favorite coding projects. No business case, no practicality for non-developers (or developers for that matter), no long term support, no problem solving. Just a love/hate letter to software and the absurdity it brings to our world.
Of course it's satire; one of the most absurdist forms of satire is finding something ridiculous yet taken seriously, and treating it far more seriously than that.
Aside from the brilliant satire, it’s worth pointing to the “What I Learned” section of the readme:
how C++ smart pointers are implemented
how to implement a Non-Fungible Token
how the Ethereum ecosystem has evolved since I wrote my last smart contract in 2017
how to integrate my previous Solidity, Truffle, and Ganache workflow with new tools such as OpenZeppelin and hosted wallets
how to write a (trivial) program in Rust without fighting the borrow checker once
how to use rust-web3, serde_json, and the openssl crates
how to call Rust from C
I often struggle with deciding what to build as a practice project when I want to learn a new skill, and this is a good reminder that “humor” is an acceptable answer. Using a satirical project to learn how smart pointers are implemented is genius.
The author has an excellent reply to a question on twitter
>> What are the gas prices like for copying a pointer?
> Copying an nft_ptr is illegal.
Moving an nft_ptr takes 87,169 gas:
https://goerli.etherscan.io/tx/0xcbe06fdd54bd9d221993c875022...
at mainnet gas prices of ~100 Gwei, equal to 0.0087169 ETH, or $18.69 USD.
(This was intentionally written to waste resources for no benefit, just like cryptocurrencies themselves)
> The C++ "as-if" rule means the compiler is allowed to optimize away the move, but it still needs to charge the $18.
The paranoid part of me worries this will be used for real in the future.
The thing with building abstractions is, once you cover enough pieces to make a complete abstraction, people might run away with it and build castles on top, completely ignoring that the abstraction is implemented in terms of a joke. And once enough software is built on it, it'll be easier to start optimizing the joke to work faster than to get rid of it...
(Also, I don't see any mention what happens to the NFT when the nft_ptr goes out of scope.)
Flask was originally an April fools joke with what the author thought was a silly design. It is now widely used, including in production systems at my company.
That’s the problem with all the idiotic blockchain projects around at the moment. I was only ninety percent sure it was a joke until about halfway through when the performance chart confirmed it but it is only slightly more ridiculous than several “legitimate” projects.
WARNING: This code is not safe to store secrets with.
From the readme:
> others may view the NFT/use the object, but only the owner can transfer/destroy the NFT/object.
> absolutely no protection against just pirating the image represented by the NFT/copying the pointer out of the unique_ptr
I would open an issue to support RFC 8959 and refuse to mint NFTs with secret-token URIs, but I think instead I will learn how to mint an NFT of RFC 8959.
If you like this kind of humor, I'd recommend following Zhouwei Zhang on twitter[1] (not affiliated). His posts, I think, resonates well with HN's audience.
With clang you can make a unique_ptr that is though. It just cannot be used for the std one as that would break existing code. But clang has an attribute [[clang::trivial_abi]] and with that the cost really is zero compared to a pointer.
"You can also help by going full r/roastme on my code: this is only my second Rust project, and I would appreciate guidance on my journey to carcinization."
This is a very clever joke, so let me dissect it:
The "carcinization" is a callout to, I presume, xkcd 2314 ( https://xkcd.com/2314/ ), about how crustaceans tend to repeatedly evolve into crabs, and xkcd 2418 ( https://xkcd.com/2418/ ), which makes the claim that any conversation with Randall evolves towards the topic of carcinization.
A cutesy nickname for Rust fans is "Rustaceans". (Rust-aceans, like crustaceans.) With some creativity, we may then see the process of becoming an experienced Rust user as another instance of carcinization, especially given the similarity between xkcd's "metacarcinization" and the way that rustaceans, as fans are wont to do, tend to find a way to make the conversation about Rust.
Correct, but I suspect most geeks who know the term know it from xkcd, and that supports the additional metajoke about changing the topic to talk about Rust.
Sorry, I know my question depends on a lot of variables.
I’m just looking for a “sanity check” example, but I only have a vague notion of pointer being a reference to a spot in memory, as well as knowing that doing transactions on the ETH network incurs fees.
Are there any “power user” examples? Like, how much would it cost to run `ls` on a folder of 200 files, or encoding a video with `ffmpeg` (or insert proper example here since I don’t know where `unique_ptr` is used lol)
If you've ever programmed, imagine kinda-sorta one move per argument per time you call a function. Like `console.log(foo, bar)` would be two moves. (This isn't literally true, it over counts a bit). Ffmpeg would be in the tens of thousands of moves for encoding a short video, maybe? They don't use unique_ptr, so it's hard to do a counterfactual.
An imperfect analogy is this is like nails/screws when building a house.
I wonder if it's possible to run a linux vm (ala jslinux) in browser, connect them to the network via a proxy to allow the apps inside the linux vm to make arbitrary connections (I think I saw a jslinux clone that uses some form of proxy to allow tcp access from inside the vm, but forgot the name), then run a kubernetes worker node in them. Then you can try to make the page viral somehow and then enjoy your huge and free kubernetes cluster!
I have a sinking suspicion that Facebook's Messenger webapp is doing exactly that - its UI has been very laggy for me in the past months, and the issue persists through refreshes, browser reboots and system reboots.
It's the only thing that makes sense. I mean, they couldn't have screwed up a chat client that badly...
It's a bit complictated, requiring npm and cargo and c++. But still, a "hello world" demonstration like this is very valuable. It wouldn't surprise me if real projects use this as a starting point.
Technical side-note: Are NFTs free to create and/or use? Or do they require contribution of processing power and/or paying "the Network" for it using your own ETH?
Making pointers on mainnet is expensive these days, I was able to stand up a Ganache testnet so that my pointers are created faster and at lower cost. Fantastic library.