The best Rust frameworks to check out in 2019
Tags: rust
Published: 2019-10-19 15:44:49

---
title: The best Rust frameworks to check out  in 2019
published: true
date: 2019-10-18 13:00:47 UTC
tags: rust
canonical_url: https://blog.logrocket.com/the-best-rust-frameworks-to-check-out-in-2019/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/nrfg91xngsiw1ebxd7u3.png
---
**Written by [Obinna Ekwuno](https://blog.logrocket.com/author/obinnaekwuno/)**✏️

[Rust](http://rustlang.com) is used to build fast, highly scale-able, memory-efficient software. Whether you’re building a CLI tool, web apps for the server or client, network services, embedded systems software or desktop software, Rust is robust enough to cater to all your programming needs.

A framework is typically a combination of tools, helpers, and libraries that provide a way to (quickly and effortlessly) build, test, and run applications. It lays out a foundation for building software. Key aspects to look out for when choosing a framework are its architecture and features (such as support for customization, flexibility, extensibility, security, compatibility with other libraries, etc).

This article aims to showcase several Rust frameworks across different niches, highlighting their strengths and shortcomings. By the end, you should be able to make informed decisions regarding the Rust framework suitable for your needs.

## Web development

### [Rocket](https://rocket.rs/)

With 8k stars on [GitHub](https://github.com/SergioBenitez/Rocket), Rocket is one of the most mature, production-ready, full-stack web frameworks. Its major strong point is that it [doesn’t make you sacrifice speed for a productive environment and vice-versa](https://medium.com/@lholznagel/comparing-nodejs-and-rust-http-frameworks-response-times-5738dfa1843d) like many frameworks do. It helps write fast, secure web applications and doesn’t sacrifice flexibility, usability or type safety.

Other cool things to note include:

- It supports JSON out of the box so you don’t need to have another dependency for that
- Form handling is easy and simple. It doesn’t let bad form requests through so your code doesn’t break. It gives you complete control over all aspects of your application
- It comes with a built-in templating support
- You can view, add, or remove cookies, with or without encryption, without hassle
- It type checks route URLs
- It runs unit tests on your applications with ease using the built-in testing library
- You can configure your application your way for development, staging, and production

My favorite feature is not having to worry about boilerplate code. Rocket makes extensive use of Rust’s code generation tools to provide a clean API, so if you want to build a server-rendered web app, Rocket is a great tool. See more on the super easy-to-understand [documentation](https://rocket.rs/v0.4/guide/).

[![LogRocket Free Trial Banner](https://i0.wp.com/blog.logrocket.com/wp-content/uploads/2017/03/f760c-1gpjapknnuyhu8esa3z0jga.png?resize=1200%2C280&ssl=1)](https://logrocket.com/signup/)

### [Actix](https://actix.rs/)

Actix a server-rendered framework. The architecture is based on Rust’s very powerful actor system and touts itself to be a fun web framework to work with. According to this [benchmark](https://www.techempower.com/benchmarks/#section=data-r18), Actix is the fastest web framework. It’s well suited for writing services with hard logic and components. You get to also use these services in an async way.

It also provides a lot of features (like logging, http/2, etc.) out of the box. Depending on your preference, it’s boilerplate code could help you get started quickly or be overkill if you’re writing a simple app. It is a great framework with proper documentation. Learn how to get started [here](https://actix.rs/docs/). It’s approachable even for the absolute beginner.

### [Nickel](https://nickel-org.github.io/)

Nickel is also a web framework for building server-rendered web applications. It is a simple and lightweight foundation for web applications written in Rust. Its [API](https://docs.rs/nickel/0.11.0/nickel/) is inspired by the popular express framework for JavaScript.

It is non-opinionated about how you should write your code which means it does not come with a template or give specific methods of doing things and has a more gradual learning curve. Nickel supports defining templates with [mustache.rs](https://github.com/spullara/mustache.rs), all you need is to create the template.

Nickel makes it easy to map JSON data directly right onto your `struct`, and by default, Nickel catches all errors with its default `ErrorHandler` and tries to take reasonable actions. So no need to write your own custom errorHandler.

Routes can be as simple as /fizzBuzz, use parameters, wildcards or even double wildcards. Middleware are the extensibility points of Nickel. It comes right out of the box with existing Middleware which you can extend should you wish to. The [getting started guide](https://nickel-org.github.io/getting-started.html) can help you right away.

### [Yew](https://docs.rs/yew/0.2.0/yew/)

Inspired by [Elm](https://elm-lang.org/) and [React](https://reactjs.org/), Yew is a modern framework for building multi-threaded web-client apps with [WebAssembly](https://webassembly.org) commonly referred to as WASM. It packs a number of great features like:

- Reusable component architecture
- Another cool feature is services. They allow for the reuse of the same logic across components. These services are stateless. It makes use of the concept of agents which is also used to share data across components and provide an overall state for your application
- It uses the [WebWorkers API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) to spawn agents in separate threads and uses a local scheduler attached to a thread for concurrent tasks. This enables high concurrency applications within the browser written in Rust

**Some of the cons include:**

- Testing isn’t completely wholesome in yew. Yes, you can test individual services but there is no way, as of yet, to test components or agents. Both integration and end-to-end testing can’t be accomplished in plain Rust at the time of this writing
- Yew seems to be in its early stages and as such, there isn’t a proper official guide on how to use it

## Desktop applications

### [Azul](https://azul.rs/)

Very similar to JavaScript’s [Electron](https://electronjs.org/), Azul is a free, functional, immediate-mode GUI framework for the rapid development of desktop applications written in Rust, supported by the Mozilla WebRender rendering engine. It packs a lot of useful features:

- Cross-platform GUI toolkit (Windows, Linux, Mac)
- Immediate-mode API, widgets are composed via function composition
- CSS styling engine, flexbox-based layout
- Built-in controls for common user interface elements
- Create custom widgets via function composition
- SVG rendering engine, 2D drawing helpers
- OpenGL integration
- Async I/O helper functions
- XML serialization and hot-reload, built-in XML-to-Rust compiler
- Single deployment binary, minimal binary size (roughly 5MB all-incl.), CPU (0 – 4%) and RAM usage (~ 50MB total)
- Hardware-accelerated OpenGL rendering (0.5 – 4ms)
- React-like DOM diffing for incremental layout and styling changes

**Cons include:**

- It doesn’t possess an extensive community and it’s still in early stages. It is production ready nonetheless.

Get started [here](https://github.com/maps4print/azul/wiki).

### [Conrod](https://docs.rs/conrod/0.61.1/conrod/guide/chapter_1/index.html)

Conrod is a portable, 2D, GUI library for Rust. It provides an immediate-mode API that wraps a retained-mode widget state graph, allowing for the exposure of a simple, robust and reactive interface while approaching the performance of traditional, retained GUI frameworks.

Intermediate-mode refers to a style of user interface API, where GUI widgets are instantiated using functions in an update or draw loop which is quite different from the more traditional “retained mode”, where widget types are constructed during the setup stage.

Features include:

- An easy to use style for highly dynamic interfaces and those that require frequent synchronization with application state
- Highly performant
- It, however, needs lots of stabilization and in my opinion, isn’t a completely robust framework as of yet but shows a lot of promise mainly due to its immediate-mode API approach

Get started [here](https://docs.rs/conrod/0.61.1/conrod/guide/chapter_2/index.html).

### [Rust Qt binding generator](https://github.com/KDE/rust-qt-binding-generator)

Based on [Qt](https://wiki.qt.io/Main) which is a very mature cross-platform user interface library. There exists a wrapper for most languages out there and of course, Rust isn’t going to be an exception.

It enjoys all the immense benefit of Qt and of course the small binary sizes which is a trademark feature of rust. These features include:

- Development allows porting an application to multiple platforms through simple recompilation
- It increases development productivity and decreases time to market, making applications future-proof
- Developing with Qt simplifies technology strategy and, ultimately, reduces costs
- Saves time, through one code deployed across all screens and platforms
- Coding in Rust gives the developer greater control and the possibility to work with numerous existing libraries
- The code is compiled to native binaries that run at full speed (no need to use a virtual machine)
- Its cross-platform software development makes it easy to create intuitive experiences for all users, no matter what system is used

**Cons include:**

- It inherently suffers the same downsides that come with Qt like the QObject and QWidget not being thread-safe
- User Experience (UX) is far from being smooth. On desktop platforms, it is easier to develop native user experience because there are more common patterns and widgets, meanwhile, mobile UX is different and there is a lack of platform-specific things
- When using QT GUI components by default, you do not get an ideal look and feel of iOS and Android

With Qt being a proven framework for cross-platform app development being supercharged with Rust makes this framework formidable and probably the most mature GUI Rust framework. You won’t have to worry about huge builds and interface complexity since the Rust Qt Binding Generator was rewritten in Rust and now available as a cargo crate. This makes development in the common case significantly simpler.

## Conclusion

As a low-level language, Rust is perfectly suitable for making user interfaces the old fashioned way, with native APIs. Sadly, in today’s world, which typically involves supporting many platforms, using native APIs is an unattractive option for many.

However, Rust’s expressiveness and high-level abstractions make it ideal for building intricate and complex user interfaces. Unfortunately, there is little consensus on what the best abstractions are especially with the uniqueness of the web. Use what works for your use case and iterate as the need arises.

There are many more Rust based web and GUI frameworks that are in their infancy like [core foundation](https://docs.rs/core-foundation/0.6.4/core_foundation/), [druid](https://github.com/xi-editor/druid), [Iced](https://docs.rs/iced/0.1.0-alpha/iced/), [relm](https://docs.rs/relm/0.17.0/relm/), and [web renderer](https://doc.servo.org/webrender/index.html) to mention a few. You can check them out, contribute or even spin up your own framework. Happy coding [😀](https://s.w.org/images/core/emoji/12.0.0-1/72x72/1f600.png).
* * * 
**Editor's note:** Seeing something wrong with this post? You can find the correct version [here](https://blog.logrocket.com/the-best-rust-frameworks-to-check-out-in-2019/).

## Plug: [LogRocket](https://logrocket.com/signup/), a DVR for web apps
 
![LogRocket Dashboard Free Trial Banner](https://i2.wp.com/blog.logrocket.com/wp-content/uploads/2017/03/1d0cd-1s_rmyo6nbrasp-xtvbaxfg.png?resize=1200%2C677&ssl=1)
 
[LogRocket](https://logrocket.com/signup/) is a frontend logging tool that lets you replay problems as if they happened in your own browser. Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay the session to quickly understand what went wrong. It works perfectly with any app, regardless of framework, and has plugins to log additional context from Redux, Vuex, and @ngrx/store.
 
In addition to logging Redux actions and state, LogRocket records console logs, JavaScript errors, stacktraces, network requests/responses with headers + bodies, browser metadata, and custom logs. It also instruments the DOM to record the HTML and CSS on the page, recreating pixel-perfect videos of even the most complex single-page apps.
 
[Try it for free](https://logrocket.com/signup/).
* * *
The post [The best Rust frameworks to check out in 2019](https://blog.logrocket.com/the-best-rust-frameworks-to-check-out-in-2019/) appeared first on [LogRocket Blog](https://blog.logrocket.com).