Rangers Protocol Virtual Machine Technology, Pt.2
Blockchain Virtualization — The Undiscovered Frontier
This article is a part of the Blockchain Virtualization series. Make sure you’ve read the previous articles.
Rangers Protocol Virtual Machine Technology Pt.1: Virtualization in The Blockchain — The Undiscovered Frontier
The previous chapter of the Rangers Protocol Virtual Machine Technology series analyzed the defects of the Ethereum virtual machine (EVM) design framework, which Rangers Protocol addresses.
While being compatible with the Solidity language, it adopts a cross-chain asset solution based on relay chain technology. This allows supporting existing Ethereum assets (including ERC20 and ERC-721) to be transferred in Rangers Protocol. According to the team’s plan, the Rangers Protocol relay chain technology will be deployed in Q3 of 2021.
As was also mentioned in the previous article, EVM lacks standard class library support. In this article, we would like to elaborate on this matter.
What is a Standard Class Library?
A standard library in computer programming is the library made available across implementations of a programming language, Wikipedia says. There are various design philosophies of the standard library. The manifestations of the standard library are different in various programming languages.
For instance, the C standard library is a collection of macros, types, and functions used to complete tasks such as input/output processing, string processing, memory management, mathematical calculations, and many other operating system services.
The C++ standard library is a set of C++ template classes that provide general programming data structures and functions, such as linked lists, heaps, arrays, algorithms, iterators, and other conceivable C++ components. The C standard library is a part of the C++ standard library.
The commonly used expression Java standard library stands for Java class library. The Java application program interface (API) is organized in packages, where each package provides a large number of related classes, interfaces, and exception handling classes. The collection of these packages forms the Java class library.
The Python language core only contains common types and functions such as numeric values, strings, lists, dictionaries, and files. The Python standard library provides additional functions such as system management, network communication, text processing, database interfaces, graphics systems, and XML processing.
Why Are Standard Libraries SSo Important?
C++ designer Bjarne Stroustrup believes that the standard library is something that every implementer must provide so that every programmer can rely on it. The standard library is the foundation of a programming language.
Application development based on any language must be developed based on the standard library as much as possible.
First of all, it can reduce the development cost, no need to waste manpower and time in favor of redevelopment.
Secondly, whether it is directly stated by the programming language specifications or determined by the informal conventions of the programming community, the standard library has been strictly verified. Its correctness and accuracy are guaranteed.
The most critical point is that the execution efficiency of the code developed using the standard library is the highest level recognized by the industry.
EVM Lacks Standard Library Support
As mentioned in the article “Rangers Protocol Virtual Machine, Pt.1”, while REVM is compatible with EVM, it also inherits the Solidity language of EVM. Besides the advantages of simple programming, strong compatibility, and extremely high efficiency, REVM also inherits a defect that Solidity carries — lack of standard library support.
Solidity does not have its own standard codebase. It has only some elementary functions built-in, which developers can only combine and reuse by themselves. For example, string slicing, cutting, and search — all these need to be implemented by developers themselves, making it more difficult for developers to develop complicated applications. The consequence of this approach is that developers need to pay attention to many fragmentary details that are not their own business rather than developing the application itself. This increases development costs for no reason.
Simultaneously, the code written in this way will be longer than the code developed based on a virtual machine with a sound standard library. The longer the code, the higher the GAS fee incurred when uploading to the blockchain environment, and the more steps required to run the code. This increases the time needed for the virtual machine to calculate the code, reduces the execution efficiency, and cannot guarantee the correctness and accuracy of the final result.
To save GAS fees, some developers will directly call code from some open-source software or write code that is not particularly comprehensive. As a result, code security cannot be guaranteed, and the code audit of smart contracts becomes more complicated.
REVM’s Own Standard Library
Rangers Protocol’s technical team believes that an excellent virtual machine also needs to be easy to use and maneuverable in addition to showing generous and elegant features in architectural design. Therefore, REVM has established its own standard class library based on compatibility with EVM. Ethereum’s original smart contract can not only be directly migrated to the Rangers Protocol for use without recompilation but also can reduce the development threshold through the smart contract built-in functions added by REVM.
Furthermore, REVM also introduces customized keywords for Rangers Protocol and allows complete cross-chain and NFT protocol functions with one sentence. Developers can use these keywords in smart contracts to enjoy the benefits of Rangers Protocol, including its unique composability and operability. Contracts that use these keywords must be compiled by REVM to generate usable bytecode.
For user programming, Rangers Protocol has now added more intuitive NFT operation functions. Rangers Protocol will also add corresponding built-in functions in the rewards pool, airdrops, DeFi, and other levels in the next stage. This will improve the efficiency of writing smart contracts.
In terms of function expansion, since the Rangers Protocol relay chain is implemented and expanded based on smart contract functions, relay-related smart contract built-in functions will also be added to expand the functions based on the REVM smart contract.
Conclusion
DeFi and NFT fields have exploded during the recent two years. Many upper-level complicated applications emerged have more and more requirements for infrastructure.
Building the standard library cannot be completed overnight and needs to be continuously improved as the real needs of developers and users increase. Even with the continuous expansion of the industry, a better mechanism than the standard library needs to be developed to improve developer efficiency and support the mass adoption of complicated applications. The optimization scheme of virtual machines is by no means limited to perfecting the standard library.
We will focus on how to solve the lack of a mature toolset in the next chapter of the series.
About Rangers Protocol
Rangers Protocol is a future-oriented virtual world blockchain infrastructure incubated by MixMarvel. It integrates cross-chain protocol, NFT protocol, and EVM protocol. As a high-performance chain group that can realize the multi-chain contract interoperability of the EVM system. Rangers Protocol serves all entrepreneurs who want to explore the blockchain world, allowing pioneer developers to freely try diverse content and applications in the Rangers Protocol ecosystem without permission.
Last modified 3mo ago
Copy link