r/rust 16h ago

Is rustbytes LLM generated?

Upvotes

Was just reading this https://weeklyrust.substack.com/p/the-never-type-is-finally-stable

and this part is very much giving me that "LLM-written" vibe:

Suddenly Result<T, !> feels honest, and dead-code detection gets cleaner because the compiler finally believes you when you say a function never returns.

For the rest of us who write Rust for a living, this matters because empty types stop being a niche party trick and start being standard kit.

Match arms on ! are allowed to be empty without the compiler side-eyeing you. And that quiet satisfaction when the type system proves a code path is unreachable? Stronger than ever.


r/rust 19h ago

๐Ÿ“ก official blog Rust debugging survey 2026 results

Thumbnail blog.rust-lang.org
Upvotes

r/rust 9h ago

๐Ÿ› ๏ธ project mimas: a statically typed scripting language for embedding in Rust

Upvotes

I've just released 0.1.0 of my scripting language, mimas, built for embedding into Rust. It's been my side project for the past few years to explore solutions to the frustrations I run into with the scripting languages I use at work as a game developer.

enum Shape {
    Circle(float),
    Rect(float, float),
}

fn area(shape: Shape) -> float {
    match shape { // exhaustive -- miss a variant, it won't compile
        Shape::Circle(r) => r * r * std::math::PI,
        Shape::Rect(w, h) => w * h,
    }
}

It still has a ways to go, but already features:

  • Static typing with inference
  • ADTs with exhaustive matching
  • T? options and T! results -- no null
  • Garbage collected -- no borrow checker or lifetimes
  • Share Rust types and functions with a macro, fully type-checked on both sides
  • Ahead of Rune and Rhai on every benchmark I run, and within range of Luau (via mlua) (numbers and methodology)

Excited to finally share this, and grateful for any thoughts. I'll be at RustConf this week so may be slow to reply, but I'll get to everything.

Website: https://mim.as

Repo: https://github.com/imlazyeye/mimas


r/rust 50m ago

I translated SVG optimizer (SVGO) to Rust

Upvotes

So there is this project, SVGO, written in JavaScript that optimizes SVG images.

I decided to try to make a Rust version translation, including its plugins, and I think I have succeeded at least quite well.

I don't have a lot of Rust experience, and LLMs helped me a lot. I have tried to do a very thorough job and have reviewed my project many times.

What I see is quite dramatic RAM reduction and pretty good speed up.

https://gitlab.com/jiiihpeeh/svgo-rs

Any thoughts on what I should do differently?


r/rust 15h ago

๐Ÿ› ๏ธ project Rusted Computer: Running Rust programs with WASM in Minecraft

Upvotes

I've worked on a passion project of mine for the past few years called Rusted Computer. It is a Minecraft Mod that allows you to program computers inside of Minecraft with Rust inspired by ComputerCraft.

Why?

Well, the best computer mod right now is ComputerCraft. And don't get me wrong, I love that mod, but you have to write your programs in Lua. And for programs bigger than small scripts are very annoying to create. So I decided to create an alternative that is fully compatible with existing CC Peripherals.

Rusted Computer uses a WASM Runtime written in Java (Chicory), but I am considering switching to a native runtime (Wasmer or Wasmtime) for newer WASI(X) features. The mod itself is written in Kotlin and (obviously) Rust for the glue library.

There is currently no release, because it is still very WIP (no documentation and missing features, I'm currently working on support for peripherals) but if there is enough interest in this, I can quickly create and publish a dev build.

https://github.com/TheBlckbird/rustedcomputer

If you have any more questions, ask me! There is no ETA for release, as I am currently working on this while going to school, so I don't have a lot of time or concentration.


r/rust 10h ago

Looking for Open Source Projects to Contribute

Upvotes

Hello everyone,

I'm trying to get a bit more experience with rust and would like to know if anyone can recommend a project to work on.

I'm looking for projects that I could work on new features possibly with a closer guidance


r/rust 14h ago

๐Ÿ› ๏ธ project Glacex 0.1.5 hehe

Post image
Upvotes

Hello people!

This is the final update of Glacex for this week, and it's looking good!

A lot of time has been spent into fixing bugs rather than creating new widgets (quality over quantity)

Also we added accessibility, themes and other features (see changelog on github)

Here's the repo if you want to check it out: https://github.com/artemtsitronov/glacex

Made by me and programmersd21. <3

[PS] We're both unemployed, and this is non-profit, sooo yea, every star helps :)


r/rust 7h ago

๐Ÿ™‹ seeking help & advice Can someone review my code?

Upvotes

I've never had anyone else other than myself take a look at my code quality/design. However it would be nice to have an actual person review my code instead. The link is here: https://github.com/dastarruer/gtkshutdown

AI is only used for writing tests (sometimes; I can't remember whether I wrote these tests myself or not but I digress). The code is entirely written by me, though I use AI to discuss design decisions. I like programming, so hand-writing the code is just more enjoyable for me (though I'm very slow at it...).


r/rust 13h ago

๐Ÿ› ๏ธ project I built a Cargo-like build tool for C and C++

Upvotes

I got tired of hand-writing Makefiles and CMakeLists.txt for small-to-medium C/C++ projects, so over the last couple of weeks I built Smidr - a build tool where you describe your project in one Smidr.toml file instead of a build script.

Example Smidr.toml:

[project]
name = "App"
type = "bin"
language = "cpp"
cpp_standard = "cpp20"

[dependencies]
raylib = "5.0.0"
mymath = { path = "../mymath" }

smidr build resolves raylib from a system install or pkg-config, and mymath by building it from the local path - no Makefile or CMakeLists.txt to write by hand.

What it does:

  • Compiler-agnostic (clang, gcc, tcc)
  • Dependencies from three sources: system libraries (pkg-config), a local path, or git (auto-resolves to the latest stable tag if you don't pin one)
  • If a dependency itself uses CMake or Meson, Smidr detects and drives that build transparently
  • Workspaces for multi-project setups
  • C/C++ support, Windows support (via MSYS2 MinGW 64-bit)

Hit 1.0.0 today, though it's still a young project. Source and docs: https://github.com/Max-Mend/smidr

Feedback, especially on rough edges, is very welcome.


r/rust 1m ago

๐Ÿ› ๏ธ project Lini 1.0 โ€” one language for diagrams, charts, schematics, floor plans and engineering drawings

Post image
Upvotes

Hey r/rust โ€” Lini is one language for figures that normally each need their own tool. One grammar, one cascade, one look across all of them.

Diagrams, mindmaps, org charts, ER schemas, sequence diagrams, charts, floor plans, circuit schematics, engineering drawings.

(The drawing above is 33 lines of Lini. every dimension and the title block come off the geometry rather than being typed in.)

It started as something we needed for our own work and grew into a whole project.

It ships a SKILL.md too, so you can hand it to an agent and have it writing figures today.

All in Rust, and fast. Pretty out of the box, but fine tunable. theming is just CSS variables. There's a WASM build too, which is what runs the playground in your browser. The syntax took us a long time to get right.

https://lini.rs - tour, gallery and playground.

https://github.com/monfa-red/lini - main repo (MIT)


r/rust 5m ago

๐Ÿ› ๏ธ project Ferrum 0.8.8: a Rust local LLM runtime with Metal and CUDA backends

Upvotes

I'm the maintainer of Ferrum, an MIT-licensed local LLM runtime.

The Rust workspace separates the engine, request scheduler, KV cache, and backend interfaces. ferrum run and ferrum serve use the same engine; GPU execution uses Metal or native CUDA operators. The server exposes OpenAI-compatible Chat Completions and stateless Responses APIs, including streaming.

Current prebuilt packages target Apple Silicon Metal and Linux x86_64 CUDA (sm89).

Source and installation instructions

I'd welcome feedback on the Rust interfaces between the scheduler, engine, and device backends.


r/rust 17h ago

Rust SQLx Performance

Upvotes

I use Axum and SQLx to build my backend, which is served on AWS ECS Fargate (512 CPU, and only one instance for now) and interacts with an RDS Postgres (t4.micro). Connection pool is set with min/max = 2/20.

My request includes 3 DB queries to 3 different tables: one from the auth middleware to check api key and each of the other 2 is just getting a record by primary key.

If I made one or two queries, itโ€™s very fast. However, if I made 200 queries concurrently to the backend, around half of queries had http latency greater than 300 ms. P80 is around 600ms. The performance is not acceptable. I did check the CPU of both RDS and ECS. Theyโ€™re quite low: both smaller than 10%. The DB latency is low as well, 5 ms on average. Is there something queued in the SQLx internally? Did anyone have the same issue?


r/rust 2h ago

๐Ÿ› ๏ธ project Keeping database credentials out of subprocesses in a Rust CLI used from GitHub Actions

Upvotes

I'm working on a Postgres migration checker called safe-migrate. One awkward part of it is that it uses real table sizes when deciding how risky a migration is.

The same "ALTER TABLE" can be uninteresting on a small table and a very different operation on one with tens of millions of rows.

So at some point something has to connect to the database.

I wanted that to happen only in a trusted sync job, never in the normal PR lint path.

The sync job reads the Postgres catalog and writes an encrypted cache. PR jobs only consume the cache.

What ended up being more annoying than expected was making that boundary survive a composite GitHub Action.

A normal run can involve toolchain setup, "actions/cache", the installer and the analyzer itself. Even if those steps don't need the database URL, a caller can still accidentally put it at job scope and make it available everywhere.

So steps that don't need secrets explicitly shadow the relevant environment variables with empty values.

Lint also starts the analyzer subprocess with "DATABASE_URL" removed from its environment entirely.

The cache is encrypted with XChaCha20-Poly1305 using "chacha20poly1305".

The cache key is generated with:

"Key::<XChaCha20Poly1305>::try_generate()"

and it can be sent straight into "gh secret set" over stdin instead of being printed and copied around.

The install path got stricter too.

Tagged releases use checksum-verified prebuilt binaries. Branches and local paths build from source. Mutable branch refs aren't accepted as release versions.

There's deliberately some overlap in the protections. GitHub masks secrets, the action registers the literal values for masking too, lint doesn't inherit the database credential, and diagnostic output gets scrubbed before upload.

It's a lot of machinery for two environment variables, but I preferred making the boundary explicit instead of relying on every caller to scope secrets perfectly.

https://github.com/dsecurity49/safe-migrate


r/rust 1d ago

๐Ÿ“ธ media reminder to cargo clean

Post image
Upvotes

been adding some unit tests and then ran a clean.

rust said "I live here now"


r/rust 20h ago

๐Ÿ› ๏ธ project Reactive GUI framework with MILP layouter

Post image
Upvotes

Have you ever tried to set height of widget A to the width of widget B and wanted them to fill the screen?
Or have you wanted to put your differently sized news article card in one grid and just let the layouter figure out the most symmetric pattern to lay them out in?

With your very own MILP solver you can express these as constraints.
The article grid example can be constrained as:

  • don't overlap article hitboxes
  • minimize area of grid

https://github.com/ElectricPulse/drevo

The future outlook is to bring it to the browser WebGPU/WASM - but that would require some work to make micro_lp on par with highs

Looking forward to your feedback!


r/rust 11h ago

Mixing an enum with bytes in a Vec

Upvotes

I'm working on converting a virtual machine from C to Rust. At the heart of it is modeling the output of the parser as an array of bytes. Think of it as an 8-bit assembly code machine with immediate addressing, so some of the bytes are opcodes and some are data used by these opcodes. I would like to have the opcodes in an enum, such as

#[repr(u8)] // Forces the variants to be u8

enum OpCode {

OpAdd = 1,

OpImm = 2,

......

}

Then

code: Vec<u8> = vec![ 0x01, 0x02, 0x2a] would represent the action

OpAdd 42

That's what exists in my dream world. With the enum shown above I can typecast Opcode values to u8 simply enough:

let op_code = OpCode::OpAdd;

let byte = op_code as u8;

But going the other way seems impossible, except for this hack:

unsafe {

let opc: OpCode = std::mem::transmute(byte);

} https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/casting-between-types.html#transmute

So, is there a safe, preferably idiomatic way to do this, or am I just stuck with my first-ever usage of 'unsafe'?


r/rust 1d ago

๐Ÿ—ž๏ธ news rust-analyzer changelog #344

Thumbnail rust-analyzer.github.io
Upvotes

r/rust 17h ago

๐Ÿ› ๏ธ project Rust on an iPad: rustc, cargo and lld compiled to WebAssembly, running on-device

Upvotes

I spent a while trying to get a Rust toolchain working on an iPad without sending code to a server, and this is where it ended up: rustc 1.98, cargo and lld compiled to WebAssembly (wasm32-unknown-emscripten), running inside WKWebView, with a build driver written in Swift that handles dependency resolution, feature unification, fingerprints and an incremental target/ directory. User code compiles to wasm32-wasip1 and runs in the app's sandbox.

Rough timings on an iPad Air M3, for whatever they are worth:

- single file, compile and run: about 0.3 s

- Cargo project with rand (proc-macros, build scripts), cold: under 40 s

- same project after editing main.rs: about 2 s

The parts that took the longest, in case they are useful to anyone attempting something similar:

Proc-macros. No processes, no dlopen. Each one is compiled to a self-contained wasm reactor and called through a synchronous host hook, watt style. Hygiene was the subtle part: a macro_rules! marked local_inner_macros that invokes a proc-macro had rustc resolving stringify! inside the wrong crate, and it took a while to find.

Memory. Between rustc's wasm heap and JavaScriptCore's limits, a cold build spends more time recycling processes than compiling. The driver keeps a pool and persists fingerprints so a killed process resumes rather than starting over.

No threads, no real filesystem. WASI shims for what std expects, a synchronous bridge for stdin, a native one for sockets.

What it is not: there is no rust-analyzer. I did compile RA to wasm and measured it, but proc-macro expansion and std sources cost more than I was willing to spend on a tablet, so the editor side is a tree-sitter engine I wrote instead: semantic tokens, go-to-definition across files and into crate sources, hover, inferred type hints, rustc quick fixes, rename, references. There is no debugger either.

And the constraint that shapes everything: your programs are wasm, not arm64. iOS does not allow executing natively generated code, so on-device compilation has to target a sandbox. Firmware for Raspberry Pi Pico is the exception, since that binary runs on the microcontroller rather than the iPad; it works and I have verified it on hardware, but it is not in this build yet. Crates with native dependencies often will not build for wasi.

It is a paid app, free for single files, and I would rather say that here than have someone find out after installing. If you want to try it: https://testflight.apple.com/join/4Yaujqd5

What I am actually after is where it falls over. Crates that fail to build, builds that die halfway, anything that behaves differently from cargo on a desktop.


r/rust 1h ago

๐Ÿ› ๏ธ project I've been building a download manager in Rust

Upvotes

Itยดs called Gunda.

I could have started with the obvious path: make an HTTP request, stream the response, write it to disk and call that the first version. Instead, I wanted to make sure the boundaries were right before network code started shaping the rest of the application.

So most of the work so far has been around making downloads durable, keeping the core independent from storage and UI choices, and making sure the state model can support interruption and recovery later without having to redesign everything.

The slightly funny part is that the project is already fairly structured, but it still doesn't download a file yet :)

That's what I'm working on now. I'm finishing the persistence work and then I'll finally wire up the first real download. I'm posting it now because this feels like a good point to get feedback before the network layer and desktop app start adding more weight to the design.

Repo:ย https://github.com/AghastyGD/gunda

If you look through it and notice something you'd structure differently, I'd be interested to hear it


r/rust 1d ago

๐Ÿ™‹ seeking help & advice Finally ! Completed Complete Rust Book

Upvotes

So recently I had completed the entire rust book but I left the macros as I was unable to understand it from the book so is there a good place to learn rust macros where it help me understand how to write and use different types of macros it will be a great help so if you know any platform pls help me


r/rust 1d ago

๐Ÿ› ๏ธ project ply: A daemonless container runtime and package manager written in Rust

Upvotes

Iโ€™ve been working on ply, a container runtime and package manager in Rust for deploying apps on individual Linux hosts.

The main idea is to treat the base system and language runtimes as named, versioned dependencies.

Influenced by Cargo and Go, a package manager where you compose your image instead of stacking layers.

The application image contains ONLY your files and dependency references. You can copy it to another host and run it; ply fetches and verifies any missing packages. Applications run as foreground processes, without a central daemon.

Iโ€™ve used it to build and deploy a Next.js app on a 512 MB VPS, with 2 GB of swap and build resource limits, keeping the running app responsive.

Itโ€™s pre-1.0. Iโ€™d appreciate feedback on the package model and the Rust runtime implementation.

https://github.com/iluxav/ply

https://blog.iluxav.com/ply-lightweight-container-runtime-linux


r/rust 1d ago

๐Ÿ activity megathread What's everyone working on this week (37/2026)?

Upvotes

New week, new Rust! What are you folks up to? Answer here or over at rust-users!


r/rust 1d ago

๐Ÿ› ๏ธ project A huge update on Gecko, my GameCube and Wii emulator!

Post image
Upvotes

I already made 2 posts, so if you're looking for the first post incl. some Q&A go here and if you want to see the last update go here.
TLDR: I made a GameCube and Wii emulator written in Rust, with many developer tools built in (a debugger, GPU FIFO replayer/debugger, and so much more). Last time I posted about a user-friendly launcher/UI written in Rust.

Today I'm sharing my project again, as I finally was able to fix many bugs and also implement a few cool new features. To summarize in short:

  • Huge speed improvements across the board. Many games that technically worked but weren't playable due to performance now work just fine (Example: LEGO Batman)
  • Savestates! You can now save and resume at any point in time
  • Freecam support in the debugger: You can now detach the camera and peak behind the scenes in any game :)

All in all this means that many games such as the LEGO games and also the Super Mario Galaxy games are now fully playable. Here is a video of Super Mario Galaxy!

I appreciate everyone's support and am looking forward to the next update! For the brave and curious I can recommend grabbing today's nightly release (dev branch) as I just pushed new fixes that make games like Xenoblade Chronicles work!

As per usual, the important links:

Feel free to connect with me! I frequently post and talk about technical bugs, challenges I faced and how I fixed them! :)

PS: I've been working on a new multi system emulator based off of my cores, supporting all major platforms and a cool UI concept for both the "average" user and developers! If you want a sneak peak before the official announcement look here. It already supports SNES in the browser (also fully written in Rust)!


r/rust 1d ago

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

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 1d ago

๐Ÿ™‹ seeking help & advice Beginner seeking some critique.

Upvotes

Hello!

I am trying my best to learn Rust without using AI (because I some personal issues related to using it that are not relevant) and I recently did my best to make a small project: https://github.com/TheMagicGlobe/Encryption-Tool-RS .

Thing is I know I made a lot of mistakes especially in the design of the project and actually using Rust to it's full potential. So I would appreciate some honest advice and resources to look at.

I do not want a rewrite or pull requests to the project or anything like that.

Just telling me where I could improve in the future would be great. I am not the smartest tool in the shed so good examples and clear resources would be amazing.

Thank you!

EDIT: I read all of your comments thank you very much for all the feedback and tips. A great community as always.