Rue: It's Alive!
I’m excited to announce that the latest iteration of Rue Lang is now released into the wild. It’s been quite the bumpy road to get here, but it’s finally ready!
You can learn more about the language itself or how to install it on the Rue documentation. There’s also a playground website where you can try some examples right in your browser.
What is Rue?
Around 3 years ago when I was getting into Chialisp, I yearned for an alternative that was more similar to modern programming languages I was used to (such as TypeScript, or more recently Rust). The strange Lisp syntax and lack of typing was frustrating to me and was harder to mentally model (though I’ve gotten more used to it by now). And usually when I get frustrated about things, I take it into my own hands to do something about it rather than complain.
So around the same time I initially started working on Rue Lang, a new programming language that compiles to CLVM. I actually had a fair bit of experience writing recursive descent parsers prior to working on Chia, so that part was natural to me. And I’d always been interested in programming language design, but never was able to write anything other than simple interpreters before.
Since I had to juggle Rue with my full time job at Chia Network Inc and other projects such as Sage Wallet, progress was slow (especially when I was procrastinating on hard to solve design challenges or compiler bugs). The compiler went through several complete rewrites from scratch due to large scale architectural issues that I learned from along the way.
However, I’ve recently had some time to work on the latest version of the compiler and I’ve gotten it across the finish line (at least for an initial release). I’m sure it won’t be perfect, but just like when I initially launched Sage, it marks a point of no return so to speak.
What is Rue solving?
One of the most common things I hear from people who are interested in developing on Chia is that it’s difficult to understand Chialisp. I believe that Rue will allow people to get past some of their initial hesitation to get involved, and focus more on the Coin Set Model rather than the language itself while learning. This combined with improved tooling will create a better developer experience for beginners.
Additionally, there’s an opportunity to add new compiler optimizations that reduce the size of the CLVM byte code for puzzles. The results are already promising, and there is room to improve. New versions of the compiler can introduce additional optimizations without breaking puzzles that still use older compiler versions.
And finally, as we start to introduce more complicated decentralized applications on the Chia blockchain, having a more capable compiler will become more important. Being able to easily audit the code, leverage powerful language server protocol features, and efficiently write many puzzles with the same codebase will increase productivity and safety.
What’s the catch?
Rue is very new, and should be considered on the “bleeding edge” at the moment. While its test suite aims to regression test common edge cases and many full example puzzles, there is bound to be bugs as with any new software. Chialisp on the other hand, has had years to be battle tested by many primitives that are deployed in production.
The plan is to incrementally roll out some puzzles using Rue on-chain, and to ensure everything is working as intended:
They will be fully tested in both the Rue compiler codebase and the driver code to ensure the puzzles work as intended
New tests will be continually added in the compiler to build confidence
CLVM byte code for these puzzles will also be manually inspected before deployment to ensure nothing was overlooked
You can never be too careful.
What’s next?
I will keep iterating on the Rue compiler, and roll out new features such as:
Editor completions
Goto definition
Type information on hover
Importing multiple files (modules)
Please feel free to give Rue a try and let me know if you have any feedback on the Sage Wallet Discord!