Current State of Rust Crates

Today’s Issue: Confidently Flatten Your Options, Introducing Tantivy, and Async Rust Isn’t Bad: You Are

Rustaceans Editors
Rustaceans
5 min readMay 22, 2024

--

Subscribe to the newsletter on our Substack if you haven’t already!

Hello Rustacean!

Welcome to another edition of the Rust Bytes newsletter. In this issue, we’ll discuss the current state of Rust crates, present you a Rust tip, spotlight an amazing Rust project, and share some incredible links of the week.

Welcome to issue 27!

THE MAIN THING

Current State of Rust Crates

Rust’s crate system is a wonderland of tools and libraries, offering everything from web frameworks to machine learning algorithms. It’s like a hardware store for programmers, but with significantly fewer existential crisis caused by misplaced hammers -metaphorically speaking.

However, there’s a catch, stability. Unlike a trusty 10mm socket wrench, many crates haven’t reached the coveted “version 1.0” status. This can leave some programmers feeling hesitant to adopt them. Let’s discuss this and see what the future holds.

Why the Slow Boat to Stable?

There are a few reasons why many crates haven’t hit 1.0:

  • Rapid evolution, Rust itself is a young and rapidly evolving language. Libraries need to keep pace, which means frequent updates and changes to APIs. Reaching 1.0 often signifies a period of stability, but in Rust’s fast-paced world, that can be hard to achieve.
  • Fear of breaking things, imagine a library update silently breaking your entire codebase! Developers are understandably cautious about making breaking changes, especially before reaching 1.0. This can lead to a longer “beta” period.
  • Community-Driven, many crates are built and maintained by passionate volunteers. These developers juggle other priorities, so reaching 1.0 can take time and dedication.

Does it Matter?

So, should you avoid “unstable” crates? Not necessarily! Here’s the deal:

  • Rust’s Versioning is Granular: Even pre-1.0 crates often have extensive versioning that allows you to pin specific versions and avoid surprises.
  • The Community Has Your Back: Rust has a fantastic and helpful community. Many pre-1.0 crates have excellent documentation and active development, making them quite reliable.
  • Innovation Awaits: Some of the most cutting-edge libraries haven’t reached 1.0 yet. By shying away from them entirely, you might miss out on exciting new tools.

The Future of Stability

The Rust community is constantly working to improve crate stability. Here are some trends:

  • More Tools: Tools like cargo-watch help developers stay on top of breaking changes and manage dependencies more effectively.
  • Semantic Versioning: Emphasis on following semantic versioning helps developers understand what to expect from updates.
  • Maturing Ecosystem: As Rust matures, libraries are likely to reach 1.0 at a faster rate.

The Takeaway

Don’t let the lack of a “1.0” label deter you from exploring Rust’s amazing crate ecosystem. Take advantage of the community, and you’ll find a treasure trove of tools to build incredible things. Remember, even the sturdiest bridges were once just blueprints!

Share

RUST TIP: Flatten Your Options with Confidence

When working with nested Option types in Rust, it's common to encounter structures like Option<Option<&str>>.

Flattening such nested structure into a single Option<&str> helps simplify your code and avoid unnecessary nesting.

You can play with the code on Rust Playground.

PROJECT SPOTLIGHT 💡

Tantivy

Tired of sluggish search engines that leave you hoofing it through results? Buckle up, because Tantivy’s here to give your searches a turbo boost!

Tantivy is a full-text search engine library written in Rust, known for its lightning speed — think of a search engine on a rocket ship.

Why Tantivy?

  • Faster than a speeding search engine: Need proof? Check out the benchmarks! Tantivy leaves its competition in the dust.
  • Lightweight and feisty: Tiny startup time makes it perfect for even the most impatient applications.
  • Built for customization: Configurable tokenizer lets you tailor it to your specific needs.
  • Multilingual maestro: Supports various languages, including English, French, Chinese, Japanese, Korean, and more (with a little help from its friends).

Not looking to build a whole search engine? No worries! Tantivy is the foundation for Quickwit, a distributed search engine built on its back.

The cherry on top? Tantivy is open-source, so you can tinker with it like a mad scientist!

AWESOME LINKS OF THE WEEK 🔗

  1. The Rust Leadership Council has just released their May 2024 Leadership Council Update. Its packed with updates you won’t want to miss.
  2. We were singing Rust Rover’s praises when it was still a beta-ly good boy! Now it’s all grown up and stable, with a free tier for the non-profit makers. Woof!
  3. According to Ntietz, Rust iterators are like ninjas — deceptively lazy but optimized into killer for-loops. Just beware the parallel processing footgun.
  4. Nate wrote about Async Rust Isn’t Bad: You Are.
  5. Armin Ronacher breaks down the secrets of using Rust macros to build your own custom VTables — it’s macro magic in action.
  6. The Tailcall team has released rust-benchmarks, revealing that pattern matching in Rust is approximately 72,000 times faster than dynamic dispatch.
  7. Pascal Seitz wrote on When allocating unused memory boosts performance by 2x.
  8. Askar Safin wrote an insightful piece on why de Bruijn indices should be avoided, especially if you’re programming in Rust. We must say, it’s a compelling read.
  9. Omar just released “Simplified Embedded Rust” — A Guide for Embedded Rust Learners.
  10. The Formal Land team wrote about translating Rust’s core and alloc crates on their blog.

Share

BEFORE YOU GO 👋

You’re our biggest fans, and we love to see it.

Here are a few ways you can help us spread the word:

That’s all for now, Rustaceans! Until next issue, take care and have fun.

--

--