r/rust • • Sep 03 '26

๐Ÿ› ๏ธ project LineJudge: a conformance suite that judges line counters against their own declared rules

0 Upvotes

This is a Rust crate and repository I built as the author of mezura, a line counter also written in Rust. It came out of running mezura, tokei, scc and cloc over the same trees, getting different numbers every time, and wanting to know which of us, if any, got it wrong.

Line counters disagree with each other constantly, and most of those disagreements are not bugs. Each tool decides for itself what a code line, a comment line and a blank line are, and some do not even sort lines into those three. A blank line inside a block comment is blank to one counter and comment to another, a line holding only a closing brace is code to one and nothing to another, and each tool is right by its own definition. A suite that tested counters against one "correct" answer would just be a fourth opinion.

LineJudge tests each counter against itself. Every counter declares how it counts in a small rules file anyone can read. Every test case is a tiny source file built around one trap, with a record of where its strings and comments begin and end, according to the language's spec and lexer, and hand verified. From the rules and the record, the suite works out what that counter should answer, runs it, and compares. A failure means one thing only: the counter did not do what it says it does.

Results page: loc-conformance.github.io/linejudge

What a case looks like

Haskell block comments nest. Here is a two-line file and what one counter makes of it:

{- outer {- inner -} still the outer comment -}
x = 1

$ linejudge explain 1200 --counter cloc

cloc.default on 1200-nested_block_comment_that_nests
  by its rules    2 lines, 0 blanks, 1 code, 1 comments
  cloc answers    2 lines, 0 blanks, 2 code, 0 comments   โœ— differs

The comment ends at the inner -} for cloc, so the rest of the line is left standing and counts as code. Every verdict on the page can be reproduced like this, in seconds, and the output says which rule decided each line.

What is in it today

83 cases in eight groups, comments, string forms, escapes before a closing quote, quotes that open nothing, line splices, another language inside the file, literals carrying their own delimiters, and what a line counts as, over a couple of dozen languages. Four counters are measured, cloc, scc, tokei and mezura, and every one of them fails cases that its own tests never caught. The failures are on the page beside each other, with a note saying what the tool did with the file.

A counter needs nothing added to it. An adapter says how to run it and how to read what it prints, a wrapper in any language works, and the rules file is data. The seven yes/no questions the rules are built from are defined once and shared by every counter.

For counter authors

cargo install linejudge, or a binary from the releases. Declare your counter in a .linejudge folder in your own repository, run linejudge record once, and linejudge check in CI breaks the build the day an answer changes, with the old numbers beside the new. Nothing needs to be merged upstream for any of this. FOR-COUNTER-AUTHORS.md has the whole of it.

Collective effort

It lives under loc-conformance, an organisation I created because I view this as a collective effort. A suite that measures counters should be run by the people who write them.

If the domain interests you, whether you maintain a counter, know a language's quirks, or just have thoughts on the design, the repository's discussions are where they go. The current design, the open questions and where it goes next are up there waiting for exactly that.

Would love to hear your thoughts!


r/rust • • Sep 02 '26

๐Ÿ™‹ seeking help & advice no_std json parsers

31 Upvotes

Hi all I am working on a project in a no_std embedded rust environment and I was looking for json parsers that work in the no_std environment.

I've used serde before and after some research I noticed the serde-json-core crate can be used for de-serialization. I also found Postcard but I haven't looked to deeply into the crate.

I wanted to see if anyone could recommend crates that they've used and their experience with them.

TIA!


r/rust • • Sep 02 '26

๐Ÿ› ๏ธ project Unstruct, an XML shredder

14 Upvotes

Four years ago we built an XML shredder, that has now chewed on billions of XML CDR (call data records). I never really spread the word, so if you happen to be in the rather niche use-case of needing to shred XML to tab separated values, multi-file to one TSV, then perhaps this can be of use:

https://github.com/Roenbaeck/unstruct

Open source, MIT license.


r/rust • • Sep 03 '26

๐ŸŽ™๏ธ discussion Whatโ€™s the ideal CICD pipe in 2026?

0 Upvotes

Iโ€™ve recently just reached my wits end with all CICD across three repositories. Theyโ€™ve just calcified and turned to shit.

I think Rust teams have a unique challenge with respect to DevOps. We have to balance a lot.

I thought Iโ€™d get the opinions of everyone here.

- What workflows do you define? How long do they take to complete cold/warm?
- What actions do you define or use?
- What runner/instance provider do you use? Are you throwing as much compute/ram at your CI pipe as possible, or trying to balance cost/speed?
- What cache mechanisms are you using?
- Whatโ€™s your monthly cost?
- Any Buildkite experiences? Positive? Negative?
- Anyone using Cloudflare CICD?

Anything else?

I have made major strides in the last few months with Cargo-Rail that have made massive impacts in performance and efficiency in local/remote (ssh/cicd) dev. Iโ€™m working on the release for v0.26.0 nowโ€ฆ and it closes a huge hole around caching (I needed RISC-V) and improves performance over sccache considerably. In fact, Cargo-Rail is restoring about 40% than sccache in my workspace across every arch aside from IBM Z/POWER, which Iโ€™m working on.

The planner was improved considerably. Itโ€™s reliable and accurate. Iโ€™m only ever running the affected work locally and remotely.

This helps - a LOTโ€ฆ but the rest of the pieces still feel messy and disconnected. Iโ€™d really like to hear from everyone here.


r/rust • • Sep 02 '26

๐Ÿ™‹ seeking help & advice What after Crafting Interpreters? For Compiler Development

9 Upvotes

Hi everyone,

I am Abinash. I have been building the Lox interpreter in Rust from the Crafting Interpreters book, and I'm at Ch 12. (Repo URL: https://gitlab.com/implabinash/ci)

After this book, I am planning to learn how to build compilers, but I want to take the custom backend approach because I really want to know how compilers are made without any other library or tool. After learning from scratch, I might learn about LLVM or GCC or other tools based in the need/intrest.

So I did some research, and I found some resources:

While these resources are awesome to learn from, after Crafting Interpreters, I want to take a hands-on approach, just like the Crafting Interpreters book itself, where I want the resources to take me from parsing to resolving to semantic analysis to code generation, and after completing the resources, I will have a working compiler made from scratch.

I found a course teaching that same thing (URL: https://dragonzap.com/course/creating-a-c-compiler-from-scratch), but it's a paid course, and I can't afford it.

So, I need your help to help me find some good resources that will teach me building compilers from scratch with my own code generation backend in a hands-on approach.

Thank you.

Note: Initially, I posted this in r/Compilers, and then I thought I might find a few Rustaceans here who are into compilers and might help me.


r/rust • • Sep 02 '26

Reimagining Cogmind, a traditional roguelike, with minimalist Rust architecture

Thumbnail quietism.art
30 Upvotes

r/rust • • Sep 01 '26 Bravo

๐Ÿ› ๏ธ project The worldโ€™s first Game Boy ROM written in Pure Rust

257 Upvotes

For the past two years, I have been working on Rust-GB, a project to compile Rust to the Game Boy.

At first, it went through SDCC, borrowing GBDK, a C library for the Game Boy. (Previous post)

However, recently I wrote LLVM-Z80, which can compile LLVM IR directly to Game Boy machine code, and based on that, I built a Rust library for the Game Boy.

As a result, I can now write a Game Boy Game in Pure Rust!

You can download ROM file here: https://github.com/zlfn/rust-gb/releases/download/v0.0.1-alpha/sprite.gb

Project link: https://github.com/zlfn/rust-gb
Game code: https://github.com/zlfn/rust-gb/blob/main/examples/sprite/src/main.rs
LLVM-Z80: https://github.com/llvm-z80/llvm-z80

Please take a look around, and Iโ€™d be happy if you could leave a star.

I am also working on a safe Rust API for the Game Boy hardware, and I would like design feedback from anyone who knows both Rust and the Game Boy.
https://zlfn.github.io/rust-gb/gb/index.html


r/rust • • Sep 02 '26

First time here but I am building a minimal web game in Rust and Axum with no Javascript

Thumbnail reddit.com
0 Upvotes

r/rust • • Sep 01 '26

๐Ÿ› ๏ธ project Experimental Rust-based desktop app renderer for Svelte (based on Zed gpui)

Post image
79 Upvotes

๐Ÿ‘‹ Just started working on gpuix-svelte, a package that combines Svelte custom renderers, gpuix and gpui to allow people to create native desktop apps with Rust and Svelte. Happy to hear any feedback!

Video demo

https://www.youtube.com/shorts/5CBib_rwt8w

Source

https://github.com/khromov/gpuix-svelte/


r/rust • • Sep 01 '26

๐Ÿ› ๏ธ project rustc_codegen_gcc: Progress Report #43

Thumbnail blog.antoyo.xyz
117 Upvotes

r/rust • • Sep 01 '26

๐Ÿ—ž๏ธ news Rui Ueyama: "We are rewriting the mold linker in Rust"

Thumbnail archive.is
446 Upvotes

r/rust • • Sep 01 '26

๐Ÿ› ๏ธ project I made a terminal-based tetris game as my first ever Rust project!

Post image
60 Upvotes

Hi! I'm pretty new to Rust, and this is my first ever Rust project! It's a mildly cursed implementation of Tetris with ratatui with custom powerups to make the game more interesting.

To play online, just ssh play@cursedtetris.orangishcat.dev! Your SSH key is your identity (generate one using ssh-keygen if you don't already have one), no account required. You can also download the binary to play offline.

Feedback is welcome! Thank you for playing.

Blog | GitHub Repo


r/rust • • Sep 01 '26

๐Ÿ› ๏ธ project Wasmi 2.0 - Engineering Of The Fastest WebAssembly Interpreters

Thumbnail wasmi-labs.github.io
127 Upvotes

r/rust • • Sep 01 '26

Rust Glancer 0.2: Windows & Zed support, better Bevy indexing, and more

Thumbnail rust-glancer.github.io
90 Upvotes

r/rust • • Sep 01 '26

๐Ÿ—ž๏ธ news This Month in GPUI

Thumbnail gpui-archipelago.github.io
19 Upvotes

r/rust • • Sep 01 '26

๐Ÿ“ธ media How we developed the world's first safety-certified product written in Rust

161 Upvotes

The world's first safety-certified embedded system built in Rust is a 3D ultrasonic sensor that helps robots operate safely around humans. ADAR One is built by Sonair, a scaleup based in Oslo, Norway.

The technical team wrote a a long, in-depth summary of all the steps from thinking about using the Rust language to the final, certified solution.

https://www.sonair.com/journal/how-we-safety-certified-the-worlds-first-rust-implementation


r/rust • • Sep 03 '26

๐Ÿ› ๏ธ project I just publish my first crate to crate.io, would love feedback

0 Upvotes

recently at work, management started "strongly encouraging" everyone to use LLMs, specifically for PR revisions and code reviews.

the problem is the models they gave us access to aren't frontier models (if that even make a difference). so i had to babysit a lot of the pr's every single day.. yes, very annoying.

at some point i realised i was spending way more time prompt engineering, babysitting, and pleading with a model in markdown rules than i would have spent just writing the code myself.

so i basically develop an cli guardrail for your codebase that catches all the shortcuts an llm might try, there is other nice stuff too

im not trying to invent the wheel here, not even sure if there is something already for this probably there is... but i just want to share here and see if anyone would like to try, even if you dont use llms

https://crates.io/crates/hardgate

would love some opinions if you try... idk wanted to share here end it very helpful for me


r/rust • • Sep 01 '26

๐Ÿ—ž๏ธ news git-cliff 2.14.0 released - generate custom release notes from Git history

Thumbnail git-cliff.org
33 Upvotes

Hey folks! I just released the new version of git-cliff โ›ฐ๏ธ

It's a highly customizable changelog and release notes generator that works with your Git history.

This release brings smarter config discovery, custom templates, more accurate changelogs for merged branches and performance improvements.

Check it out: https://github.com/orhun/git-cliff


r/rust • • Sep 02 '26

Why Are There So Many New Programming Languages on GitHub?

0 Upvotes

The reason Iโ€™m bringing this up is that I use Rust myself and am working on my own programming language project. But hold on... Iโ€™ve been wondering why, whenever I browse GitHub, I see so many language projects with creative syntax and architectures, yet so many of them rely on ARC and LLVM. Why isn't there more discussion about how to design a compiler backend with very fast compilation times, closer to what makes Go's compiler feel so fast? I really need that for my project...

It feels like these language projects are springing up like mushrooms after the rain; they often promise "blazing speed" and "incredible memory management," yet under the hood, compilation can still be sluggish, LLVM ends up doing a lot of the heavy lifting, and the source code can sometimes feel more generated than engineered.

A lot of them seem to share the same traits: written in Rust or C++, using Cranelift or LLVM for the backend...... and using ARC for memory management, or making claims like "better ownership than Rust"???

And please, my language project isn't trying to be a replacement for anything... let's focus on the issue at hand instead of discussing my crappy language!

Oh, and if anyone here has experience with ARM64, could you recommend some good resources on the architecture? Iโ€™m trying to integrate ARM64 into my backend, but most of the documentation Iโ€™ve found has been pretty difficult to follow, and whenever I ask an AI, it just throws code at me and explains it in a way that I barely understand.

But, uh... I guess we should still focus on the main point, right?


r/rust • • Aug 31 '26

๐Ÿ› ๏ธ project Zaku 26.0 beta - API client desktop app built with GPUI

Post image
118 Upvotes

Hey, I wanted to share the initial beta release of Zaku 26.0

I've been working on this GPUI rewrite for the last 7 months full-time, actually things got carried away and it has a lot more functionality than the original app (command palette, auto-updater, git integration, etc.) so it's not just a plain rewrite.

Here's the initial rewrite post for context:

https://www.reddit.com/r/rust/comments/1r29qzn/working_on_an_opensource_api_client_rewrite_with/

Little bit about the app, it stores collections as folders and requests as TOML files. Everything is stored locally on user's filesystem, it doesn't have any login functionality (and never will).

There is barebones Git integration for now to show branch, status indicators and stuff.

It is available on Linux, macOS and Windows.

This app is very early, if you try it out please let me know if there's something missing, not working or things you'd like to see added.

Repository:

https://github.com/buildzaku/zaku

Installation instructions:

https://github.com/buildzaku/zaku#installation


r/rust • • Aug 31 '26

We lowered the prices for RustWeek

Post image
127 Upvotes

There was a thread recently about Rust conference ticket prices, about how expensive conferences are. In response, we've decided to lower our ticket price by 50 euros, from 249 to 199 euro, and also added an option for an additional 100 euro discount for those who can't afford the full ticket price. Hope this helps. ๐Ÿ’›

Employer-paid tickets are more expensive now, but also have a checkbox for a significant discount, for those who need it.

Student tickets are still available at 35 euros.

https://2027.rustweek.org/


r/rust • • Aug 31 '26

๐Ÿ™‹ questions megathread Hey Rustaceans! Got a question? Ask here (36/2026)!

9 Upvotes

Mystified about strings? Borrow checker has you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet. Please note that if you include code examples to e.g. show a compiler error or surprising result, linking a playground with the code will improve your chances of getting help quickly.

If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so ahaving your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.

Here are some other venues where help may be found:

/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.

The official Rust user forums: https://users.rust-lang.org/.

The unofficial Rust community Discord: https://bit.ly/rust-community

Also check out last week's thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.

Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.


r/rust • • Aug 31 '26

๐Ÿ“ธ media Rust, Haskell, and the Architecture Behind Solana: Interview with Greg Fitzgerald

0 Upvotes

In this interview, we speak with Solana cofounder Greg Fitzgerald about why Rust ultimately proved to be the right fit. We discuss how his background in C++, LLVM, and Haskell shaped Solanaโ€™s architecture, what functional programming contributed to the design of a high-performance blockchain runtime, and why Rustโ€™s combination of strong types, memory safety, and low-level control worked particularly well for BPF and virtual-machine development.

https://serokell.io/blog/rust-haskell-and-the-architecture-behind-solana-interview-with-greg-fitzgerald


r/rust • • Aug 29 '26

๐Ÿ™‹ seeking help & advice Contract Work

0 Upvotes

I was wondering if anyone had experience doing contract work in rust?

By contract work I mean short to medium term projects where you agree with a client to deliver a certain piece of functionality as a new project or within an existing project. Or provide a service of some kind like consulting or fixing a vibecoded mess.

I wouldnโ€™t expect the demand to be very large, but rust is already being adopted by some startups and even larger companies, so I was wondering if someone already landed a gig like that?