To Rust or Not to Rust
Today’s Issue: 2024 State of Rust Survey, World of Rust and the Blazing Fast Backend You’ve Been Waiting For
Hello Rustacean!
Welcome to another edition of the Rust Bytes newsletter.
In this issue, we'll discuss a recent rant from a frustrated Rust developer, challenge you to implement a matrix transposition, spotlight an amazing Rust project, and share some incredible links of the week.
Here’s issue 47 for you!
THE MAIN THING
To Rust or Not to Rust
Recently there was a reddit post that expressed a conflicted relationship with the Rust programming language. While acknowledging Rust's technical superiority over C++, the author ultimately chooses C++ due to practical career concerns.
This decision sparked a broader discussion about the challenges Rust faces in gaining wider adoption.
Here's my take on all of this, feel free to check out the full post here!
The Allure of Rust and the Sting of Reality:
The author highlights Rust's strengths: powerful tooling (Cargo), a rich library ecosystem (crates.io), and a focus on memory safety and efficient code generation. However, these advantages are overshadowed by the lack of critical mass in the job market.
The "Betamax" Problem:
The author compares Rust's situation to Betamax, a technically superior technology that ultimately lost the format war to VHS. The argument centers on the importance of adoption: even superior technology needs widespread use to thrive.
Challenges to Adoption:
Steep Learning Curve: Rust's ownership and borrowing system presents a significant learning barrier, especially for developers coming from other languages.
Limited Job Opportunities: While Rust's popularity is rising, the majority of Rust-related jobs are in specialized domains like cryptocurrency or cybersecurity. This makes it difficult for general developers to find Rust-specific positions.
Competing Technologies: Safer C++, faster iteration cycles with Go, and advancements in JIT JavaScript and WASM pose significant competition for Rust.
Lack of Big-Name Sponsors: Unlike many popular languages backed by major corporations, Rust lacks a similar level of industry support and promotion.
A Community in a Bubble?
The author criticizes the Rust community for not prioritizing job discussions, suggesting a culture of self-congratulation instead of acknowledging real-world challenges.
Discussion Points:
Balancing Theory and Practice: Can Rust find a way to maintain its technical excellence while becoming more accessible to developers driven by employment prospects?
The Importance of Mentorship: How can the Rust community encourage and support new developers to overcome the initial learning curve?
Building Bridges: Can collaboration with other programming communities foster interest in Rust's capabilities?
This rant expressed the frustration of a developer who appreciates Rust's strengths but prioritizes career stability.
While Rust holds immense promise, it faces real obstacles in achieving mainstream adoption. Addressing these challenges will be crucial for Rust to fully realize its potential as a leading programming language.
RUST CHALLENGE
Last time, we implemented the Atbash cipher. Thanks to everyone who gave it a shot. The solution to the Atbash cipher can be found here in the Rust Playground.
Let's move on to our next challenge.
Instructions
Problem Statement:
Write a program that performs matrix transposition. The matrix is given as a vector of vectors, where each inner vector represents a row of the matrix. The task is to transpose the matrix, meaning you should convert the rows into columns and vice versa.
Requirements:
Implement a function
transpose
that takes a 2D vector (matrix) and returns its transpose.The input matrix can have rows of different lengths, so your program should handle this correctly (i.e., non-square matrices).
If the matrix is empty, return an empty matrix.
Instructions:
Input: A 2D vector (matrix) of integers. The matrix can have different numbers of rows and columns.
Output: A new 2D vector (transposed matrix) where the rows become columns and vice versa.
Example:
Sample Input:
let matrix = vec![vec![1, 2, 3],vec![4, 5, 6],vec![7, 8, 9],];
Sample Output:
vec![vec![1, 4, 7],vec![2, 5, 8],vec![3, 6, 9],]
You can start writing and testing your code on Rust Playground. Once completed, please share your solution on Twitter, or as a reply to this email.
PROJECT SPOTLIGHT 💡
TrailBase
If you’re tired of clunky backend setups, endless dependencies, and sluggish data retrieval speeds, TrailBase might just be your new best friend.
This open-source application server is like a turbocharger for your mobile, web, or desktop applications. 🚗💨
Built on Rust, SQLite, and V8, TrailBase offers type-safe APIs, a built-in JavaScript/ES6/TS runtime, authentication, and even an admin UI—all wrapped up in one delightful, self-hostable package.
What makes Traibase tick:
Blazing Fast Performance: With sub-millisecond latencies, TrailBase eliminates the need for caches, ensuring you never have to deal with stale or inconsistent data. Because who has time for that?
Zero Dependencies: No need to worry about system dependencies or worrying if your setup will work on a new machine. It’s a self-contained, single binary that you can drop and run.
Built-In JS/ES6/TS Runtime: If you need to execute JavaScript or TypeScript in your backend, it’s ready to roll without extra hoops to jump through.
Type-Safe APIs: Say goodbye to runtime errors in API calls. Rust’s type system means you get compile-time guarantees, reducing bugs before they even happen.
Authentication Out-of-the-Box: Ready-made authentication mechanisms to help you secure your app without reinventing the wheel.
Why It’s Great
Admin UI: A fully functional admin UI so you can manage your app’s data, check logs, and more, right out of the box.
SQLite + V8 Power: Whether you need a lightweight database solution or high-performance JS execution, TrailBase delivers both with SQLite and V8 engine integration.
Check out and see for yourself how TrailBase can level up your backend game. GitHub Repository.
AWESOME LINKS OF THE WEEK 🔗
It's time for Rust's annual wellness check! 🏋️♀️ Your input matters. Take the 2024 State of Rust Survey.
Jaakko Rinta-Filppula wrote about Hashing passwords at 1500 requests per second and beyond.
RustWeek is calling all Rustaceans! 📣 Want to share your Rust wisdom? Submit your talk proposal now!
Pop!_OS Rust-based Desktop Environment Cosmic Alpha 4 released.
Caio wrote an interesting piece on Building a real-time chat using WebSockets over HTTP/2 streams.
Ferrostar is taking flight on iOS! ✈️ Check out Stadia Maps' latest article on building a cross-platform navigation SDK in Rust.
Bin Wu wrote an interesting article series on 🦀 Mastering Rust Programming Tools—and guess what? It starts with making an LED blink! 💡.
TheBigCheese wrote Designing a const `array::from_fn` in stable Rust.
Nikita Popov's got a love affair with LLVM! ❤️ Dive into the world of Rust and LLVM in his latest lightning talk.
Austin Starks' Rust-fueled trading journey is inspiring! 🚀 Learn how he rebuilt his algorithmic trading platform and why he's all in on Rust.
BEFORE YOU GO 👋
You're Rust Bytes biggest fans, and we love to see it.
Here are a few ways you can help us spread the word:
❤️ Recommend Rust Bytes to your friends.
🤳 Connect with us on our socials: X, Rustaceans Publication.
📨 Email us at rustaceanseditors@gmail.com feedback is welcome.
☕️ Support our editors and Buy Us Coffee.
That's all for now, Rustaceans. May your holidays be merry and bright... and may your code compile without errors! 🎅🧑🎄 Happy holidays!
John & Elley.