Rust Icon


Rust is a systems programming language created by Mozilla.
142 Stories
All Topics


Linus Torvalds: Rust for the kernel could possibly be merged for Linux 5.20

Speaking this morning at The Linux Foundation’s Open-Source Summit, Linus Torvalds talked up the possibilities of Rust within the Linux kernel and that it could be landing quite soon – possibly even for the next kernel cycle…

The Linux 5.20 merge window will open following the release of Linux 5.19 stable around the end of July, so at that point we’ll see if the Rust PR is submitted and lands for this next kernel version. It wouldn’t be too surprising with how things have been pacing and already having the blessing of Linus.

Lots of positivity about this in the attached comment thread.


Tauri (a cross-platform app toolkit) goes 1.0

Tauri is an app framework built with Rust. You build UIs for it using virtually any frontend JavaScript framework. It has three major tenets: security, privacy, and environment. Speaking to the latter:

The apps you make are lean and performant, which reduces electricity, storage space, and general natural resource consumption. Every byte saved is a leaf on a tree that gets to grow.

This project has gotten a lot of early interest because, well, people have been waiting for an Electron alternative to emerge. Now that Tauri is 1.0 I’m guessing adoption will really start to take off.

Even more good news: we have an episode on Tauri in the hopper for ya 💪


Rust is hard, or: the misery of mainstream programming

I entered Rust four years ago. To this moment, I co-authored teloxide and dptree, wrote several publications and translated a number of language release announcements. I also managed to write some production code in Rust, and had a chance to speak at one online meetup dedicated to Rust. Still, from time to time I find myself disputing with Rust’s borrow checker and type system for no practical reason. Yes, I am no longer stupefied by such errors as cannot return reference to temporary value – over time, I developed multiple heuristic strategies to cope with lifetimes…

But one recent situation has made me to fail ignominiously.

Rust is hard, or: the misery of mainstream programming


fclones – an efficient duplicate file finder and remover

Duplicates taking up tons of space on your home NAS? fclones quickly identifies duplicates, even when there’s 10s of thousands that you’re scanning over the network:

fclones treats your data seriously. You can inspect and modify the list of duplicate files before removing them. There is also a –dry-run option that can tell you exactly what changes on the file system would be made.

Also check out the algorithm used to detect duplicates.


A cross-platform file explorer powered by a virtual distributed filesystem

Spacedrive helps you organize your files across many devices in one place. Here’s the motivation:

Many of us have multiple cloud accounts, drives that aren’t backed up and data at risk of loss. We depend on cloud services like Google Photos and iCloud, but are locked in with limited capacity and almost zero interoperability between services and operating systems. Photo albums shouldn’t be stuck in a device ecosystem, or harvested for advertising data. They should be OS agnostic, permanent and personally owned. Data we create is our legacy, that will long outlive us—open source technology is the only way to ensure we retain absolute control over the data that defines our lives, at unlimited scale.

A cross-platform file explorer powered by a virtual distributed filesystem


What I learned from making a DNS client in Rust

Adam Chalmers:

Over the last few weeks I built my own DNS client. Mostly because I thought dig was kinda clunky. Partly because I wanted to learn more about DNS. So here’s how I built it, and how you can build your own too. It’s a great weekend project, and I learned a lot from finishing it.

DNS is simple enough that you can grok it quickly, but still complex enough that Adam learned a ton along the way: reading RFCs, network sockets, Bitvec, and more.


A handy way to handle sh/bash CLI parameters

So Argc is a little Rust program that your bash scripts can use to make handling command-line parameters easy. You describe the options, parameters, and subcommands in comments like this:

# @describe A demo cli

# @cmd Upload a file
# @arg target!                      File to upload
upload() {
    echo "cmd                       upload"
    echo "arg:  target              $argc_target"

Then you trust Argc to parse that and do the heavy lifting:

eval "$(argc -e $0 "$@")"

The only drawback (aside from potential parsing bugs) to this approach is your script now depends on having argc in the machine’s executable path. i.e. – it’s not portable.

What’d be even cooler, IMHO, would be to instead use argc as a pre-processor of sorts that spits out a pure-bash implementation from your input script. Regardless, a cool idea!


A Git-compatible DVCS that is both simple and powerful

Jujutsu (jj at your CLI) combines features from popular distributed version controls systems (Git, Mercurial, Darcs) with features not found in any of them, such as:

  • working-copy-as-commit
  • undo functionality
  • automatic rebase
  • safe replication via rsync/Dropbox/etc

And since it’s Git-compatible, adoption should be a breeze.

Jujutsu has two backends. One of them is a Git backend (the other is a native one). This lets you use Jujutsu as an alternative interface to Git. The commits you create will look like regular Git commits. You can always switch back to Git.

I’ve often wondered what will come next after Git. I’m not saying this is that thing, but it’s cool to see people working on the problem.


PRQL – a modern language for transforming data

PRQL (pronounced “Prequel”) aims to be “a simpler and more powerful SQL”

Like SQL, it’s readable, explicit and declarative. Unlike SQL, it forms a logical pipeline of transformations, and supports abstractions such as variables and functions. It can be used with any database that uses SQL, since it transpiles to SQL.

To get an idea on PRQL’s design, they provide this SQL statement as an example:

    AVG(salary) AS average_salary,
    SUM(salary) AS sum_salary,
    AVG(salary + payroll_tax) AS average_gross_salary,
    SUM(salary + payroll_tax) AS sum_gross_salary,
    AVG(salary + payroll_tax + benefits_cost) AS average_gross_cost,
    SUM(salary + payroll_tax + benefits_cost) AS sum_gross_cost,
    COUNT(*) as count
FROM employees
WHERE salary + payroll_tax + benefits_cost > 0 AND country = 'USA'
GROUP BY title, country
ORDER BY sum_gross_cost
HAVING count > 200

And then translate it to PRQL, which looks like:

from employees
filter country = "USA"                           # Each line transforms the previous result.
let gross_salary = salary + payroll_tax          # This _adds_ a column / variable.
let gross_cost   = gross_salary + benefits_cost  # Variables can use other variables.
filter gross_cost > 0
aggregate by:[title, country] [                  # `by` are the columns to group by.
    average salary,                              # These are the calcs to run on the groups.
    sum     salary,
    average gross_salary,
    sum     gross_salary,
    average gross_cost,
    sum     gross_cost,
sort sum_gross_cost                              # Uses the auto-generated column name.
filter count > 200
take 20

The New Stack Icon The New Stack

The case for Rust as the future of JavaScript infrastructure

Lee Robinson from Vercel/Next.js:

Rust is now replacing parts of the JavaScript web ecosystem like minification (Terser), transpilation (Babel), formatting (Prettier), bundling (webpack), linting (ESLint) and more. Let’s take a deep dive into why this trend is gaining popularity and wider adoption.

We just discussed this topic (and some apprehension about it) on JS Party last week. Definitely a trned worth brushing up on, if you haven’t already.


An easy-to-use, zero-downtime schema migration tool for Postgres

Reshape… automatically handles complex migrations that would normally require downtime or manual multi-step changes. During a migration, Reshape ensures both the old and new schema are available at the same time, allowing you to gradually roll out your application.

Designed for Postgres 12+ and experimental for now. Do not use in production until it shapes up.


Dura is a background process that watches your Git repos

If you ever get into an “oh snap!” situation where you think you just lost days of work, checkout a dura branch and recover.

Without dura, you use Ctrl-Z in your editor to get back to a good state. That’s so 2021. Computers crash and Ctrl-Z only works on files independently. Dura snapshots changes across the entire repository as-you-go, so you can revert to “4 hours ago” instead of “hit Ctrl-Z like 40 times or whatever”. Finally, some sanity.

This sounds a lot like how Fossil works out of the box, except maybe even more paranoid because Fossil will propagate every commit whereas Dura propagates all changes even before they’re committed.


Experimental Rust support lands in the Linux kernel

Check out the original RFC to find the genesis of this effort. Here’s the opening pitch:

We know there are huge costs and risks in introducing a new main language in the kernel. We risk dividing efforts and we increase the knowledge required to contribute to some parts of the kernel.

Most importantly, any new language introduced means any module written in that language will be way harder to replace later on if the support for the new language gets dropped.

Nevertheless, we believe that, even today, the advantages of using Rust outweighs the cost. We will explain why in the following sections.

Godspeed to everyone collaborating on what will surely be a massive, years-long undertaking.


An embedded OS all in Rust

Bryan Cantrill, announcing Hubris and Humility:

… we found ourselves increasingly forcing existing systems out of the comfort of their design centers, we wondered: was our assumption of using an existing system wrong? Should we in fact be exploring our own de novo operating system? In particular, our colleague Cliff Biffle, who had a ton of experience with both Rust and embedded systems, had a vision for what such a system might look like (namely, the system that he had always wanted for himself!). Cliff dove into a sketch of his ideas, giving the nascent system a name that felt perfectly apt: Hubris.

There’s some serious innovation going on at Oxide and I can’t wait to see what they do next.


An open source alternative to Cloudflare Workers

Blueboat aims to be a developer-friendly, multi-tenant platform for serverless web applications. A monolithic approach is followed: we try to implement features of commonly used libraries (in the web application context) natively in Rust to replace native Node addons, improve performance and reduce duplicated code. Blueboat’s architecture ensures the security of the platform, prevents code duplication and keeps the overhead low.


elfshaker is version control fine-tuned for binaries

elfshaker is a CLI tool written in the Rust programming language. It stores snapshots of directories into highly-compressed pack files and provides fast on-demand access to the stored files. It is particularly good for storing lots of similar files, for example object files from an incremental build.

They’ve had phenomenal results when using this with clang builds.


Rust and JavaScript, sitting in a tree (Next.js 12)

Have you heard? The just-released 12th version of Next.js uses a Rust-based compiler (swc) to achieve ~3x faster local refreshes and ~5x faster production builds.

Compilation using Rust is 17x faster than Babel and enabled by default using Next.js 12, replacing transforming JavaScript and TypeScript files. This meant we had to port the Babel transformations in Next.js to Rust, including a brand new CSS parser in Rust used to implement the styled-jsx transform.

With the increased popularity of Rust and Go-based JS tooling, could there be a future where we don’t use any JavaScript to build our JavaScript apps? 🤔

0:00 / 0:00