Introduction
This section covers the advantages of Rell and its position within the Chromia platform.
You can read Rell's release notes here.
Rell language
Most dapp blockchain platforms use virtual machines of various kinds. But a traditional virtual machine architecture doesn't work very well with the Chromia relational data model, as we need a way to encode queries and operations. For this reason, ChromaWay is taking a more language-centric approach: a newly developed language called Rell (Relational language) that's used for dapp programming. This language allows programmers to describe the data model/schema, queries, and procedural app code.
Rell code gets compiled to an intermediate binary format, which is code for a specialized virtual machine. Chromia nodes then translate queries in this code into SQL (while ensuring this translation is safe) and execute code as needed using an interpreter or compiler.
Rell has the following features:
- Type safety / static type checks. Rell is much more type-safe than SQL, ensuring that types returned by queries match those used in procedural code. Catching programming errors at the compilation stage is very important to prevent financial losses.
- Safety-optimized. Arithmetic operations are safe right out of the box, and programmers don't need to worry about overflows. Authorization checks are explicitly required.
- Concise, expressive, and convenient. Many developers dislike SQL because it's highly verbose. Rell only bothers developers with details that can derive automatically. As a data definition language, Rell is up to 7x more compact than SQL.
- Allows meta-programming. We don't want app developers to implement the basics from scratch for every dapp. Rell allows feature bundling as templates.
Our research indicated that no existing language or environment has this feature set, and thus the development of a new language was necessary. We designed Rell in such a way that it's easy to learn for programmers:
- Programmers can use relational programming idioms they're already familiar with. However, they don't have to go out of their way to express everything through relational algebra: Rell can seamlessly merge relational constructs with procedural programming.
- The language is deliberately similar to modern programming languages like JavaScript and Kotlin. A familiar language is easier to adapt to, and our internal tests show that programmers can become proficient in Rell in a matter of days. In contrast, the ALGOL-style syntax of PL/SQL generally needs to be more intuitive to modern developers.
Rell structure
As mentioned, Rell is a language designed for relational blockchain programming. The structure of a decentralized app built in Rell looks something like this:
The end user communicates with the client, sending transactions to Rell using a postchain client.
- The Core concepts section guides you through the concepts needed to create a program in Rell.
- For code references, see features.