witnet

2 min read - Posted 15 Nov 18

8 reasons Witnet Is Building With Rust


article image

Having its own underlying blockchain, Witnet requires code that is as fast as C or C++ but memory safe to prevent security vulnerabilities. At the same time, we want to produce concurrent code that can take advantage of modern hardware. After analyzing the possible languages to use, we found that Rust is a fast, memory safe and highly concurrent language which allows for writing complex multithreaded code without race conditions or dangling pointers. It allows fearless concurrency without compromising on performance.

Having an undeniable influence from functional languages like ML or Haskell, Rust is very expressive yet it uses high level abstractions. This makes it easy to write correct and readable code, which in turn translates into faster and more productive development.

Rust is statically typed but it sports a really nice type inferer which makes code succinct and readable. The absence of a garbage collector and low runtime requirements makes it easy to embed Rust code inside other languages like Python, Ruby or Nodejs. This is fundamental for building the bridges between Witnet and other blockchains as well as with the headless browser that will allow Witnet to perform web content retrievals.

The Rust compiler is simply awesome, offering the most helpful messages we have seen in a compiler. It also has incremental compilation, which helps developers save their valuable time.

No more reinventing the wheel. Unlike C or C++, Rust has a package manager — a tool called cargo. Besides managing the dependencies of the project, cargo gives you the option to build, run, test, generate documentation and publish your own package to a community driven package repository.

Metaprogramming. Rust macros allow for reusing code in a concise, well-abstracted way with a powerful compile-time correctness checking.

And last but not least, Rust has an ever-welcoming community that is always willing to help and is currently growing at a very healthy pace.

Summing up, here are the 8 reasons why Witnet will make the most of Rust :

  1. Performance

  2. Memory safety

  3. Concurrency

  4. Influence from functional languages

  5. Statically typed with type inference

  6. Awesome compiler and tooling

  7. Metaprogramming

  8. Thriving community

By the way, do you love Rust and want to join one of the most exciting projects using it in the blockchain space? We’re hiring!

Created with Sketch.Content is"CC-BY-SA 4.0" licensed
Article On-chain
Article Author

Witnet

Decentralized Oracle Network

33

0

0

0 Comments
Related Articles
Team Insights: Anler, Functional Programmer

Hi Anler! Welcome to the team, it’s awesome to have you! Could you start by telling us a bit about you and your background? Hi there! My name is Anler and I’m from Cuba. I learned to program quite late, at the age of 19 when I started university. The languages I used then were C and C++ since I was studying Automation Engineering. I dropped out of university in order to emigrate to Spain where my dad lived. Once in Spain, I immediately was fascinated by the Internet and the amount of information

Witnet

19 Nov 18

Team Insights: Mario, Full Stack Dev and Scrum Master

Today we’re interviewing Mario , the latest team member to join Witnet! You can also read other Team Insights we’ve published: Adán , Daniele , Johann , María and Anler . Hi Mario! Welcome to the team, it’s awesome to have you! Could you start by telling us a little bit about you and your background? Hi! Thanks for the warm welcome to the Witnet team! I consider myself a curious person and I always push myself out of my comfort zone in order to learn new things and face new challenges. Actually,

Witnet

19 Nov 18