About Predrag Gruevski

An independent software engineer applying compiler technology to the data space. I most often write about Rust, compilers, performance optimizations, and data querying technology.

The RSS's url is : https://predr.ag/atom.xml

Please copy to your reader or subscribe it with :

Preview of RSS feed of Predrag Gruevski

Is this trait sealed, or not sealed — that is the question

1970-01-01 08:00:00

cargo-semver-checks v0.35 can determine whether Rust traits are "sealed", allowing it to catch many tricky new instances of SemVer breakage. Why is accurate sealed trait detection so important, and why is implementing it correctly so hard?

How to Query (Almost) Everything

1970-01-01 08:00:00

In 2022, I gave a talk at a virtual conference with an unforgettable name: HYTRADBOI, which stands for "Have You Tried Rubbing a Database On It?" Its goal was to discuss unconventional uses of database-like technology, and featured many excellent talks.

My talk "How to Query (Almost) Everything" received copious praise. It describes the Trustfall query engine's architecture, and includes real-world examples of how my (now-former) employer relies on it to statically catch and prevent cross-domain bugs across a monorepo with hundreds of services and shared libraries. For example:

The Wi-Fi only works when it's raining

1970-01-01 08:00:00

SemVer in Rust: Tooling, Breakage, and Edge Cases — FOSDEM 2024

1970-01-01 08:00:00

Four challenges cargo-semver-checks has yet to tackle

1970-01-01 08:00:00

My last post covered the key cargo-semver-checks achievements from 2023. Here are the biggest challenges that lie ahead!

Many of the remaining challenges in cargo-semver-checks are obvious: we all want more lints, fewer false-positives, etc. etc. Let's set those aside.

Instead, let's talk about four non-obvious challenges we have yet to tackle:

Highlights of 2023 for cargo-semver-checks

1970-01-01 08:00:00

2023 was a big year for cargo-semver-checks! We saw ecosystem-wide adoption in projects of all shapes and sizes: the tokio and PyO3 ecosystems, company-backed OSS projects from companies like Amazon and Google, and even in cargo itself. Here's a look back at the highlights of 2023!

Checking semver in the presence of doc(hidden) items

1970-01-01 08:00:00

cargo-semver-checks v0.25 squashes nearly all bugs related to doc(hidden) items — its most common source of false-positives. What does doc(hidden) mean in Rust, and why was handling it correctly so hard?

Semver violations are common, better tooling is the answer

1970-01-01 08:00:00

Breaking semver in Rust by adding a private type, or by adding an import

1970-01-01 08:00:00

A few days ago, I started polls on Mastodon and Twitter whether adding a new private type, or an import, can ever be a major breaking change. The consensus was that this should be impossible.

I agree with that. It should be impossible.

I've discovered a way to cause a previously-public type or function to disappear from a crate's public API by making innocuous-seeming changes like adding a private type or adding an import, etc. It is not a hypothetical problem, either — I've found at least one real-world Rust project that has been affected by it.

A definitive guide to sealed traits in Rust

1970-01-01 08:00:00

For the longest time, I thought that "sealed trait" in Rust was a singular concept implementable in one specific way. To prevent downstream crates from implementing your traits, you make the traits sealed — done, end of story. I was wrong! It turns out there are multiple ways to seal traits, forming a pleasant spectrum of options:

Mediocrity can be a sign of excellence, and other stories

1970-01-01 08:00:00

Re-exporting an enum with a type alias is breaking, but not major

1970-01-01 08:00:00

We've already explored some of the dark corners of Rust semantic versioning on this blog:

Speeding up Rust semver-checking by over 2000x

1970-01-01 08:00:00

This post describes work in progress: how cargo-semver-checks will benefit from the upcoming query optimization API in the Trustfall query engine. Read on to learn how a modern linter works under the hood, and how ideas from the world of databases can improve its performance.

Moving and re-exporting a Rust type can be a major breaking change

1970-01-01 08:00:00

Some Rust breaking changes don't require a major version

1970-01-01 08:00:00

Turning a Rust struct into an enum is not always a major breaking change

1970-01-01 08:00:00

cargo-semver-checks today and in 2023

1970-01-01 08:00:00

Falsehoods programmers believe about undefined behavior

1970-01-01 08:00:00

My HYTRADBOI'22 Jam

1970-01-01 08:00:00

Debugging Safari: If at first you succeed, don't try again

1970-01-01 08:00:00

Toward fearless cargo update

1970-01-01 08:00:00

I recently built cargo-semver-checks, a linter that ensures crates adhere to semantic versioning. This is why and how I built it.

Fearless development is a key theme throughout Rust. "If it compiles, it works", fearless concurrency, etc.

But there's one aspect of Rust (and nearly all other languages) that isn't entirely fearless yet: cargo update, upgrading the versions of the project's dependencies.

Compiler Adventures, part 3: Value Numbering

1970-01-01 08:00:00

To ace exams, get better at the easy questions

1970-01-01 08:00:00

Compiler Adventures, part 2: Constant Propagation

1970-01-01 08:00:00

Compiler Adventures, part 1: No-op Instructions

1970-01-01 08:00:00

How Paxos and Two-Phase Commit Differ

1970-01-01 08:00:00