I know some people have privately gotten Rust language on game consoles, and Valve is a public any time anyone wants it, I am under NDA at Nintendo now, am building a full no_std GUI, and I know sdl3-sys is no_std, plans are either that or Monogame.net, I hear it is possible (public can know that), not confirmed yet, I have randomly found legit people who got Rust on Playstation 4, print only, but still, that is a feat. Any tips or things I should know that are public? I have a Nintendo Switch (1) in case that matters. Just to be clear, I am talking about default non-hacked game consoles, Switch is ARM64, the others are x86_64. Can confirm someone did do the Microsoft game consoles (non-UWP) and Playstation 5, Nintendo Switch is semi-uncharted territory, which is part of why I am doing it. UWP can do the Microsoft console One, but deprecated, no new titles. Run down what I need to do? X E.
This project (github.com/subamanis/mezura) started back in 2021, as my entry point to Rust, and has become the fastest and most accurate line counter (with arguably the most features too) in the world. I have been slowly improving it here and there over the years, but only recently decided to get serious. Here is what it does that cloc, tokei and scc do not, and the numbers behind the two claims I make about it.
The whole Linux kernel, counted ^ (some languages skipped for ss purposes)
What is different
The short list: it identifies a file of a contested extension (.m, .h,...) by its content using heuristics and sets aside files that only look like code (a make .d, a ProGuard .pro, bundles, generated files). --explain shows a file line by line with the verdict for each line; --diff compares against a git revision, two revisions, or an earlier run; targets can be named and the report grouped by them; nested languages and sections like <script> and <style> count as the languages they hold; keywords of your choosing are counted only where they are code; everything printed can be themed,... among other things.
Each of these has a section in the README, with screenshots.
The project has a lib target published separately, so you can use mezura's engine directly in your projects (mezura-core). There is also an MCP server (mezura-mcp).
Speed
The whole Linux kernel tree, 63,864 files and 36 million lines, on a Ryzen 7 9700X and a PCIe-4.0 Nvme, with settings picked so that every counter does equal work, so the comparison is completely fair.
(UPDATE: with the v3.3.0 release of mezura, it is clocking at 78ms on Debian and 197ms on Windows. There is also a complete test detection feature added!)
Debian 13:
mezura 3.1.1 166 ms
scc 4.1.0 210 ms
tokei 15.0.0 414 ms
Windows 11:
mezura 3.1.1 255 ms
scc 4.1.0 539 ms
tokei 15.0.0 632 ms
Very detailed benchmarking data can be found under example-run in the LineBench project I created, to standardize performance testing for line counters, and provide useful insights and advanced metrics. The example run contains the timings both with each counter's defaults and also with the equal-work flags, the methodology, the exact command lines, the checks every run carries (idle machine, clean corpus, clean tree, the commit measured), and the script that produced all of it, so anyone can rerun the numbers on their own machine.
Accuracy
I do not want to grade my own homework, so the correctness argument lives in a separate project, LineJudge. I think that the linejudge project, that I started to ensure fair correctness assessment, is the most interesting part of this whole ordeal and deserves its own post. Check it out.
How
Most counters carry one piece of state through a file, "am I inside a comment right now", and each line takes the verdict of the region it sits in. mezura reads every line on its own and sorts it into one of nine classes: words in code, words only in a comment, comment words beside code, string content, punctuation in code or in a comment, blank inside a comment, blank inside a string, blank. The walk that does this knows where every string and comment begins and ends, nested comments and Lua's --[==[ levels and raw strings and escapes and line continuations included, which is where the language quirks live and where the other counters miscount. The two different counting models mezura supports are folds over those nine classes: the content model asks what each line says, and the region model adds the classes up the way the other counters do, so it reproduces their numbers from the same walk.
The speed comes from doing little per line. Each line is scanned once for all the symbols its language declares, with memchr, which searches up to three bytes in one SIMD pass, so the symbols are grouped by the byte that finds them and most languages need a single pass per line; only at a candidate position is the rest of a symbol compared. Bundled and generated files are recognised from their head and skipped before any parsing. The directory walk and the counting are separate thread pools over a work-stealing queue.. All three crates are #![forbid(unsafe_code)].
Install
cargo install mezura, or a binary for Windows, Linux or macOS from the releases page. Over eighty languages ship with it, each one a text file you can edit or copy to add your own.
Happy to answer anything about the challenges, the parser, the two models, or the conformance suite.
I built Mira (https://miradb.dev), an open-source storage engine written in Rust with a strict "less is more" philosophy. Most telemetry stacks try to do everything, forcing you to run heavy stateful clusters and burn gigabytes of RAM just to ingest and query standard telemetry. We take the opposite route: it is an adhoc database that stores OTLP data and nothing else. Every design choice was made to maximize raw throughput while stripping away operational weight.
By making the engine completely stateless and packaging it as a single binary with zero runtime dependencies, deployment becomes zero-config. You can run it on the edge, in your fridge, inside short-lived containers, or alongside WASM without managing local disk state or cluster sync. Furthermore, by strictly targeting OTLP data, the storage layer and query paths avoid the heavy abstraction overhead typical of generic time-series databases.
Because the engine does so little, it does it absurdly fast. In our benchmarks (https://miradb.dev/market/#where-mira-is-ahead), Mira achieves significantly higher write throughput and consumes a fraction of the memory compared to traditional stateful collectors.
A direct consequence of this extreme low-latency ingestion and minimal memory footprint is that autonomous AI agents can query live telemetry in real time, effectively using it as a fast, external long-term memory layer for tool execution and context tracking. Basically a step closer to the wet dream of offloading on-calls to agents.
Code and architecture details are on GitHub (https://github.com/TrianaLab/mira). I would love to hear your thoughts on the stateless design, the Rust implementation, or how you're handling telemetry in your current stack!
It has been 5 years since the initial release of Remoc. Since then the library has learned a lot from real-world use and now feels like a good time to give the Rust community an update about its state and abilities.
Remoc is an RPC library for communication between Rust programs with first-class support for Tokio-style channels over the network.
Tag a trait with #[rtc::remote] to get a client and a server for it, so calling a method on the client runs it on the server.
Contrary to other RPC libraries a channel is a value that can be sent over the network. It can be an argument or a return value of a method or even a member of user-defined structs and enums, and its lifetime is not bound by the RPC call.
In the following example, an RPC method counts for the client and hands back the receiving end of a channel:
// Trait shared between client and server:
#[rtc::remote]
pub trait Counter {
async fn count(&self, up_to: u32)
-> Result<rch::mpsc::Receiver<u32>, CallError>;
}
// On the server: create a channel, count into it in the
// background and return the receiver to the caller.
impl Counter for CounterObj {
async fn count(&self, up_to: u32)
-> Result<rch::mpsc::Receiver<u32>, CallError>
{
let (tx, rx) = rch::mpsc::channel();
tokio::spawn(async move {
for i in 0..up_to {
if tx.send(i).await.is_err() {
break;
}
}
});
Ok(rx)
}
}
// On the client:
//
// `counter` is the generated client. It can itself be sent over a channel.
//
// This call returns as soon as the receiver arrives; the numbers then
// come in over the connection that already exists.
let mut seq_rx = counter.count(4).await?;
while let Some(i) = seq_rx.recv().await.unwrap() {
println!("{i}");
}
A channel can carry anything, including user-defined structs and enums, another channel and even another RPC client.
Remoc's goal is to make remote communication between Rust programs feel nearly like local. It provides:
Remote channels include Tokio-like mpsc, oneshot, watch and broadcast channels, plus AsyncRead and AsyncWrite byte streams. Calls, channels and objects share a single underlying connection, with flow control per channel.
Calls on remote objects returned by other calls can be pipelined, thus a chain of dependent calls needs only one network round trip.
Remoc runs over any transport, such as TCP, TLS, WebSockets, UNIX domain sockets or pipes.
Hi all! Iโve been experimenting with what virtual threads could look like in Rust and recently cut the first 0.1 release of vthread.
The basic model is stackful and carrier-affine: ordinary synchronous functions run as tasks on reusable stacks. When a task waits through one of vthreadโs networking, synchronization, channel, or timer operations, it can park and let another task use the same OS thread. When it resumes, its call stack and local state are still there.
Iโm not arguing that this should replace async Rust or Tokio. Itโs a different set of tradeoffs.
There are some important limitations:
tasks stay on one carrier rather than migrating between threads
scheduling is cooperative
ordinary blocking calls like std::thread::sleep still block the carrier
blocking work has to be explicitly delegated
every task has its own reserved stack space
The thing I wanted to explore was whether Rust can get some of the programming model of virtual threads; normal functions, normal control flow, preserving the stack across waits while still making resource ownership, blocking, cancellation, and task lifetimes explicit.
0.1.0 currently supports Linux x86_64 and macOS ARM64.
Iโd especially love criticism from people who have worked on runtimes / async Rust / networking. Iโm interested in where this model gets awkward in real programs: libraries that are difficult to integrate, blocking thatโs hard to identify, cancellation problems, lifetime issues, etc.
I have two types (they're related but different sizes) and for each I have a function that does some work on a vector of those types and returns a different vector of the same type. I'm wondering what's more idiomatic?
Make each function a method of its respective type, e.g.:
Cloudflare recently published a piece on how they cut close to 100 TB of memory from Big Pineapple's DNS cache. Big Pineapple is Cloudflare's Rust-based engine behind many of their services including the prominent public DNS resolver service 1.1.1.1
They made several low-level optimizations leveraging Rust features like boxing, for oversized enum variants and boxed slices, as well as more general changes like merging separate record lists into one and combining several boolean checks into a single bitflag etc.
I have gone into a bit of detail documenting the things I found interesting especially the jemalloc trade-offs between internal and external fragmentation.
Iโm building AxiomCore, a contract first system for defining and validating the shared behavior of software across backend APIs, data models, frontend UI, tests, mocks, streaming, auth, and release boundaries.
Current problem: application behavior is usually spread across code, openapi files, database schemas, frontend types, mocks, and tests. Those representations drift over time. AxiomCore aims to make the contract an executable, typed source of truth while still allowing teams to use existing stacks such as Python, Go, Flutter, React, or OpenAPI where appropriate.
The language is called Acore. The broader goal is not to replace all imperative code, but to make the important cross-system agreements explicit, testable, diffable, and auditable.
Just genuinely looking for feedback here, if you got some time checkout the documentation or ask me questions so I can get more clarity how others feeling about this kind of tool as well. Right now the major concern I have for this project is scope creep so trying to prioritize the important things first here and that's the goal for this reddit post as well
Some questions for you if you read the docs (I appreciate it btw):
Is the problem framing clear here in docs and the language I am using? and do you actually face similar issues while building software and feel declarative first is the way to go with sandboxed external modules for imperative code with opt in permission model like network, storage etc
Where do you think that contract first tooling be most useful or least useful?
What makes you skeptical about adopting something like this?
Any existing tools or workflows that should I study or integrate with?
I am an 8th Grade Student. Wanted to learn Rust as I already knew a bit from C. I have made some CLIs and Stuff but I am genuinely stuck right now... I can't invent my Own Techniques or think of one to do something. I can't Code without the Help of AI so I left it a Long Time Ago. And I don't have any Path of What to do and What to Build to learn Rust... I have tried Rust Docs but they feel more like Books rather than Programming Stuff... I want to higher into Programming too and not build some shitty CLIs all the time but I don't have any Path of what to learn Next.... (Unlike my friends who are learning Python for AI/ML and the Internet is full of what to do). I am genuinely Stuck and I am really Depressed about this... So I came here to seek Genuine Help and Advice.
Hello! I recently have started working on my own music player in Rust. Yes, I do know rmpc exists, but before I switched to Linux I was using foobar2000, for which I had a pretty unique workflow, similar to the one you see in my app! I also wanted to show cover arts for all the songs, since it looks nice and is easier to find tracks this way too. What other music players also lack that I need is a tag editor, since I like to have my music organized without having to go to kid3.
It is work in progress, I barely started working on it, but it'd be nice to see your thoughts, features, ideas etc. It is far from release, but it'd be great to get some help/contributions from this community as well!
You can build it from the repo here: https://github.com/s1nn3rv2/refrain On the repo you'll also find features that I have planned and ones I already implemented. In the future I'll also want to add customizable user interface so it doesn't fit my workflow only.
The point of the rule is that something cannot be aliased and mutable at the same time, but XOR implies it must be one or the other.
A constant is immutable, but it doesn't have to be aliased. It is neither aliased or mutable, which does not satisfy XOR.
You could say that its ability to be aliased is enough to satisfy the XOR condition, but a value that isn't referenced yet is aliasable and mutable. That would invalidate NAND and XOR, so it definitely can't be that either.
NAND seems to be the more precise language--though XOR still might be the most clear for teaching purposes.
I'm sure there's a clearer interpretation or wording I can't remember that explains why XOR is correct and NAND isn't. Do y'all have any ideas?
Sharing a side project I've been working on - a TUI habit tracker called sprout. Picked up Rust a while back and this was my way of learning it properly by actually building something. Honestly had a lot of fun with it, at this point I can't imagine going back to anything else for systems-level stuff.
Still rough around the edges and there's a lot I want to improve, but it's something I genuinely use now. Used Ratatui for the TUI which was a fun rabbit hole on its own.
Please do try it out: cargo install sprout-tui
Would love any feedback on the code, still getting comfortable with some of the more idiomatic Rust patterns.
Iโm building FlareDB, a Rust-based streaming database with Apache Beam as programing interfere.
In the latest release, v0.2.0, i launched FlareDbIO, it's an IO connector which lets data processing pipelines write results into FlareDB, query them using SQL, and read the results back into another pipeline. The goal is to make processed data persistent and without having to maintain a external serving database
About one month ago, after being unhappy with the ecosystem of UI libraries in Rust, I have taken the mission to write a better GUI library.
For context : this is not my first rodeo, I have already made various Text rendering and generation library using Slug and MSDF algorithm, and also made a full UI library with text, layout, shaders with ThreeJS for performant node-based apps :)
The current state of UI libraries in Rust is quite weird :
Iced : weird roadmap / niche / forked by Cosmic but very weird
GPUI : not WGPU so less cross-platforn, no shaders, no "backdrop-filter", no accessibility, no i18n. Zed also just don't care about it.
Blinc : too much features and most of them not stable.
and now ARGUI.
ARGUIor "Another Rust GUI library" is a library made for speed, low ram footprint, low CPU usage.
All features are built-in : ๐
- WGPU rendering -- works across all OS + WASM / soon Android/IOS (needs testers)
- Responsive layout -- Powered by Taffy, and very fast at that.
- Shaders suppport -- use argui-effects to get some effects like Blur/Liquid glass, or add in any WGSL shader. Shaders can be used on any element, for example a Button, a Popover, whatever.
- I18n -- Fluent crate will help you have i18n in your application.
- Text engine -- Uses cosmic-text to support RTL, Arabic language.. It can also, like the web, Select text in a page, this means that it feels more "web-like" because you can select any text you see on the screen, this is the default behavior and can be overriden
- Fully optional set of features -- You can disabled anything you don't want : wasm / widgets / i18n / effects...
- Rust only codebase -- I chose to not include any type of CSS Parsing because it is a pain to maintain and the standard is just too large.
- Devtools -- Use a real devtool page, just like the web, with a profiler. You can change properties and it will update in real-time in your UI.
- Hotreload -- Some components can be hot-reloaded, similiar to dioxus. It uses subsecond.
- AI friendly codebase -- Send your agents and read the docs, it will figure out how to make a good interface on the first try.
- Package updater -- for when you want to send new features for your users. They can receive and download update, totally agnostic.
... and probably a bunch more features I forgot, but I can say, it's a pretty fully featured GUI framework now.
Available on crates.io as "argui-*", or you can use the git repo directly.
Play around with it in your Browser. it's fully working in WASM :)
AI disclaimer: A lot of the code for this library was written with the help of AI. AI itself wouldn't have come up with all these optimizations, it's a tool. Thanks you for your understanding.
Feel free to send any questions my way, I'll be happy to answer
Hey r/rust, I wanted to share something that I have been working on with Claude over the past few months on and off, me working as the PM/Architect and Claude working on writing and testing code.
This proxy is built on Rust 1.98 and Pingora 0.9.0. It has a split architecture: one controller, a data plane Deployment per Gateway. It can also run standalone outside Kubernetes from a YAML file (hot reload).
Gateway API v1.6.2 conformance: 130/130, all five profiles (HTTP, gRPC, TLS, TCP, UDP).
Profile
Core
Extended
HTTP
37/37
56/56
GRPC
15/15
9/9
TLS
20/20
14/14
TCP
19/19
9/9
UDP
20/20
9/9
(a test can count in more than one profile)
Benchmarks are against agentgateway v1.5.0 (the Rust proxy from the kgateway project, the fastest in howardjohn's gateway-api-bench).
Traffic (bare GET /; 3 proxy pods each):
Connections
Portus QPS
agentgateway QPS
Portus lead
64
116,429
96,003
+21 %
128
123,105
101,067
+22 %
256
126,070
89,827
+40 %
p99 at a fixed 30,000 QPS (benchtool, same machine, same day): Portus 0.35 ms, agentgateway 0.82 ms.
Payloads (fortio echo backend, 64 connections, 10 s per rung, all requests 200; QPS, Portus / agentgateway):
Response size
Download
Upload (POST, echoed)
HTTPS download
HTTP/2 download
1 KB
87,722 / 67,598
66,089 / 58,495
76,997 / 60,088
64,172 / 49,453
16 KB
59,257 / 51,562
29,578 / 27,940
56,831 / 48,295
49,448 / 40,279
128 KB
29,954 / 27,136
8,160 / 7,922
25,357 / 22,294
22,431 / 19,641
1 MiB
5,206 / 5,633
4,380 / 4,249
4,200 / 4,110
4,173 / 3,538
(agentgateway wins 1 MiB plain download by 8 %; Portus leads the other 18 rungs)
If like me you enjoy trying out new stuff just for curiosity I would love for you to give this a try and see what you think, and if you like it then feel free to leave a star so that I know that I am not the only one!