Tag: c++

nft_ptr

C++ std::unique_ptr that represents each object as an NFT on the Ethereum blockchain.

Why?

Biggest issue facing $125 billion security industry: Memory safety.
“~70% of the vulnerabilities addressed through a security update each year continue to be memory safety issues.” – Microsoft Security Response Center

The world’s largest codebases are written in C++
Browsers, operating systems, databases, financial systems

C++ memory management is hard to understand, opaque, and not secure

As we all know, adding blockchain to a problem automatically makes it simple, transparent, and cryptographically secure.

Thus, we extend std::unique_ptr, the most popular C++ smart pointer used for memory management, with blockchain support

Non-Fungible Tokens and std::unique_ptr have the exact same semantics:
each token/object is unique, not fungible with other tokens/objects
each token/object is owned by 1 owner/unique_ptr
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

Written in Rust for the hipster cred.

2021-11-11: Funny and poignant web3 critique here:

Even at comparable stages in their development, the World Wide Web and Web 2.0 were not quite so … self-referential? They were about other things — science and coffee pots and links and camera lenses — while Web3 is, to a first approximation, about Web3. For all the Web3 rhetoric around the potential rewards for “users”, Ethereum only recognizes “wallets”. One user can control many wallets; one BOT can control many wallets; Ethereum doesn’t know the difference, doesn’t care. Therefore, Web3’s governance tools are appropriate for decision-making processes that approximate those of an LLC, but not for anything truly democratic, which is to say, anything that respects the uniform, unearned — unearned!—value of personhood.

C Is Not Low-level

For a language to be “close to the metal,” it must provide an abstract machine that maps easily to the abstractions exposed by the target platform. It’s easy to argue that C was a low-level language for the PDP-11. it is possible to make C code run quickly but only by spending 1000s of person-years building a sufficiently smart compiler—and even then, only if you violate some of the language rules. Compiler writers let C programmers pretend that they are writing code that is “close to the metal” but must then generate machine code that has very different behavior if they want C programmers to keep believing that they are using a fast language.”

GMock

nice

Today, we are excited to release Google C++ Mocking Framework (Google Mock for short) under the new BSD license. When used with Google Test, it lets you easily create and use mock objects in C++ tests and rapid prototypes. If you aren’t sure what mocks are or why you’ll need them, our Why Google Mock? article will help explain why this is so exciting, and the Testing on the Toilet episode posted nearby on this blog gives a more light-hearted overview. In short, this technique can greatly improve the design and testability of software systems, as shown in this OOPSLA paper.

Development of C

The C programming language was devised in the early 1970s as a system implementation language for the nascent Unix operating system. Derived from the typeless language BCPL, it evolved a type structure; created on a tiny machine as a tool to improve a meager programming environment, it has become one of the dominant languages of today. This paper studies its evolution.

neat