Rust Icon

Rust

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

Git github.com

A fast terminal UI for Git

Here’s the motivation behind this Rust-based TUI:

I do most of my git work in a terminal but I frequently found myself using git GUIs for some use-cases like: index, commit, diff, stash, blame and log.

Unfortunately popular git GUIs all fail on giant repositories or become unresponsive and unusable.

GitUI provides you with the user experience and comfort of a git GUI but right in your terminal while being portable, fast, free and open source.

A fast terminal UI for Git

Lőrik Levente levminer.com

Tauri vs Electron with a real world app

Lőrik Levente shared a real world comparrison between Tauri and Electron using a real application he’s building called Authme. The comparrison focused on all the major things you’d care about — Bundle size, startup time, performance, app backend, rendering your app, security, auto update, and developer experience.

Also, see this tweet from swyx.

Tauri vs Electron results are consistently mindblowing

App: 97% smaller
Startup: 50% faster
RAM: 33% less
Security: priceless

So, is Electron is being replaced? Lőrik says yes, but…

Tauri vs Electron with a real world app

Svelte github.com

The Svelte compiler rewritten in Rust

When Rich Harris was last on JS Party, he wondered aloud:

“Should I learn Rust? Should we rewrite the Svelte compiler in Rust?” Maybe it’s a terrible idea, I don’t know, but I think it’s at least worth investigating.

Well, the effort we’re linking to here isn’t by Rich, but another member of the Svelte community. Their reasoning:

My main reason for doing this, is to compile Svelte without Node.js and possibly use Deno instead.

And the state of the project:

This is still a big work in progress. I’m mainly working on this for fun and learning. I came up with the name rustle by combining rust and svelte (ruslte => rustle). The project is open to naming suggestions!

Rust ralfj.de

Announcing: MiniRust

Ralf Jung has been thinking about semantics of Rust… a lot:

The purpose of MiniRust is to describe the semantics of an interesting fragment of Rust in a way that is both precise and understandable to as many people as possible… Specifically, MiniRust is specified by a reference interpreter that describes the step-by-step process of executing a MiniRust program, including checking at each step whether the program has Undefined Behavior.

Source code here.

Tooling prql-lang.org

PRQL is a modern language for transforming data

The P in PRQL (pronounced “Prequel”) stands for Pipelined, which I’m convinced is a great way of writing and reasoning about queries:

A PRQL query is a linear pipeline of transformations

Each line of the query is a transformation of the previous line’s result. This makes it easy to read, and simple to write.

It compiles to SQL, which means it’s compatible with most databases already and there are currently bindings for Python, JS & Rust, which is the compiler itself.

Try it out in their web-based playground. (Thanks, Wasm!)

Linux phoronix.com

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.

Rust tauri.app

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 hirrolot.github.io

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

Rust github.com

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.

Rust github.com

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

The Changelog The Changelog #487

Warp wants to be the terminal of the future

Today we’re talking with Zach Lloyd, founder of Warp — the terminal being re-imagined for the 21st century and beyond. Warp is a blazingly fast, rust-based terminal that’s being designed from the ground up to work like a modern app. We get into all the details — why now is the right time to re-invent the terminal, where they got started, the business they aim to build around Warp, what it’s going to take to gain adoption and grow, but more importantly — what’s Warp like today to get developers excited and give it a try.

Rust blog.adamchalmers.com

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.

Bash github.com

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!

Git github.com

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.

Databases github.com

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:

SELECT TOP 20
    title,
    country,
    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,
    count,
]
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.

PostgreSQL github.com

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.

0:00 / 0:00