XIO

xWire

Posts from every feed QUEST has found across the web — blogs, news, podcasts, channels and more.

The Rust Programming Language Forum - Latest topics

Latest topics

Logging and EU Cyber Resilience Act

The EU Cyber Resilience Act (CRA) specifies, that Security relevant events must be logged unless explicitly opted out by the user. We're currently using the log crate with env_logger, and I couldn't find a way for how to determine security relevant events using log's API, i.e. it has no sec!() log level or similar. Rolling own logging code may be an option, but since we're using several dependencies, we'd also have to patch their respective logging in order to identify security-relevant log…

API design: 1) error locations & 2) top-level re-exports

Hi folks, I'm nearing the end of a major overhaul to what has become quite a large library (redbook for handling cd audio). The crate covers 3 key domains: hardware access logical representation of a CD (named tracks etc. - all the stuff that would be printed on the disc / booklet / case) technical information read from a CD (table-of-contents entries, time formats, etc.) Plus a few key types which combine all of the above (e.g. an AudioCd which represents a disc in a drive) The implementation…

Project to install RustUp on Linux, Windows and macOS

I am working on a project that allows Rust to be installed on the following operating systems: Linux, Windows and macOS. The aim is to check that the necessary libraries are installed and that rustup is not installed. At the moment, I only have it set up for one Linux distribution, but the plan is to gradually extend it to other distributions, as well as Windows and macOS. I’d like to hear your feedback. I know the code isn’t quite up to scratch yet, but the idea is to create a working…

XDP + userspace TCP for a high-performance proxy?

Hi, I've been working on zeroio. My goal is to build a fast network dataplane in Rust using XDP and a userspace TCP stack, with support for congestion control, SNI/QUIC forwarding and DDoS protection. So far, L7 performance has been quite disappointing compared to just using the kernel TCP stack. Has anyone here tried something similar? I'm wondering if I'm missing something obvious or if userspace TCP just isn't a good fit for this kind of workload. Would love to hear your thoughts. 1 post - 1…

How do I install packages in Linux using Rust commands?

I need install a packege how to curl in linux, I need to install a package such as Curl on Linux, but the problem is that when it comes to installing it, I don’t know how to enter the superuser password when prompted. Here is the function I’m using. use std::process::Command; pub fn install_curl(package_manager: &str, args: &[&str]) -> bool { Command::new(package_manager) .args(args) .output() .map(|value| value.status.success()) .unwrap_or(false) } Example of command with Arch: sudo pacman -S…

Rolling upgrades in tellus: old code cannot learn a new shape

During a rolling upgrade, old and new nodes of a cluster exchange messages while their types change. Old code cannot learn a new shape, so in tellus the new code bridges both ways: it upcasts what old nodes send, and it downcasts what it sends to them. My latest blog post shows how that looks in code, with the Schema trait and the cluster demo's Pong, which changed shape between two versions of the demo application: Heiko Seeberger Rolling upgrades in tellus: old code cannot learn a new shape…

Where does ownership and borrowing rules shine?

Hi everyone! Do concepts like ownership and borrowing specifically exist in Rust to prevent UB in multithreaded context? (In multithreaded env, it's quite clear: forcing the spawned thread to take ownership of a String. This prevents other threads from modifying it at the same time.) Or it's applications shine in single threaded contexts as well? Thanks! 6 posts - 5 participants Read full topic

General purpose LLM harness - browser UI, ollama_rs

Repository rgbellotti/llm_rnd_harness GitHub - rgbellotti/llm_rnd_harness: Local, single-user LLM R&D harness (Rust) Local, single-user LLM R&D harness (Rust) This harness is focused on detail-oriented work such as diagnostics or research. It's my first public repo of "vibe coded" software, or more specifically it started out as utilities and tests for local models using ollama and ChatGPT, then started taking shape as a functional harness using Grok Build and Opencode, added/fixed features by…

What i have built with my small UI framework?

Hi everyone, I want to share something about my UI framework Aimer. It's using declarative pattern and able to build the app for MacOS, Windows, Linux, IOS, Android, IOS and Web. There are something that i have built using Aimer: Rust Forum Client I am building it for testing the layout, performance and cross-platform ability. Annote Annote is an experiment note app for testing framework's text compositor for handling huge chunk of text buffer. As the result i found a lots of performance issue…

Multicalc v0.11.0: Robotics and math in no_std rust, now tested across real silicon

Sense, plan, estimate and control in stable no_std Rust in one integrated package, with no heap and no unsafe. Run the same code from your laptop to a Cortex-M4. A simulated demo: A Franka Panda loaded from its MuJoCo model, on 1 kHz computed-torque control. It carries a payload that its model does not know about, also gets random pushes every 4 seconds. A momentum observer detects the pushes from the joint readings alone, and the hand holds its path. Open it in your browser. What's new Tested…

Does anyone actually length-check CStr::from_ptr?

I was doing some FFI wrapping and saw this note in the CStr::from_ptr documentation (CStr in std::ffi - Rust): The nul terminator must be within isize::MAX from ptr Because malloc and objects in C generally use size_t which is equivalent to usize::MAX, it would seem like we need to check this constraint right? For example on a 32-bit system we might have a 3GB string which is more than CStr can handle. Looking through various projects and the standard library I can't find anyone checking this.…

[AI] Cargo prune - delete old incremental build artifacts

As you may or may not know, I actually get paid to write Rust. In my day job I am working on a growing enterprise grade codebase. Even on my dev machine with 2TB SSD, repeated running of unit and integration tests and building and running test releases quickly fills up the SSD thanks to cargo's new incremental build feature. Since I usually don't want to delete all that stuff using cargo clean, I was looking for a more fine-grained option to prune the cache. I found cargo prune which hasn't…

[Announcement] tauri-plugin-updater-plus: Electron-style blockmap differential updates for Tauri v3

Hi everyone! I'd like to share tauri-plugin-updater-plus (v0.2.0), an Apache-2.0 licensed differential updater plugin and standalone CLI (blockmap-gen) for Tauri v3 applications. GitHub: https://github.com/0x8000/tauri-plugin-updater-plus crates.io: https://crates.io/crates/tauri-plugin-updater-plus Motivation Out of the box, desktop app updaters typically download the entire release artifact on every update, even when only a small fraction of the binary or bundled assets changed. Traditional…

POC: colorless-serde — exploring sync/async ("colored") serialization & deserialization (and looking for help)

I've been hacking on an experimental proof-of-concept port of serde using colorless, exploring what it looks like when serialization and deserialization can operate across sync (Identity) and Async execution modes—including when the type being serialized itself awaits async data (like an MPSC channel) or when a sink implements both sync and async writes. What's working right now Async / sync serialization: You can serialize types where the sink is async and the Serialize impl itself .awaits…

Derive_dst - review requested particularly re soundness & usability

Hi folks, After the somewhat euphoric experience of finding a pattern which allowed me to create a custom DST with a size only identified at runtime ... I thought - that looks like a good candidate for a derive macro, how hard could it be? Well one weekend (and a bit) later and I have finally, published derive_dst. Handling all the general possibilities and adding good error messages turned into a real "pass the salt" but I'm quite pleased with the initial result. I'd be really grateful for any…

Static Allocation + Constant Work in Rust: Gatekeeper Global Allocator and Constant-Time Glancer - seeking design review

Hi all, I've been implementing matklad's Static Allocation, Constant Work as a small Rust glancer (like a mini rust-analyzer). The goal is a classic TigerBeetle pattern: INIT -> FREEZE -> SERVE Allocate everything at startup (StubTable::with_capacity() sized like --orders-max) Call GATE.freeze() to deny any further heap growth SERVE with zero heap allocation and constant P100 latency What I built 1. Allocation-free termination path (mod sys) A 1KB stack buffer + StackWriter + direct write(2) /…

Tellus 0.6: stashing, rolling upgrades and a faster cluster

tellus is an actor framework for Rust on Tokio: synchronous message handlers, death watch with an ordering guarantee, supervision, event sourcing and clustering. 0.6 is out: Stashing, opt-in per actor type: an actor can defer messages while it waits for something and handle them later in order. A terminated signal keeps its place, so the death watch ordering guarantee survives stashing. Rolling upgrades: every payload carries the schema version of its type, and every node announces the…

Fail-closed allowlist on streamed JSON events: walking serde_json::Value vs typed structs?

I'm writing a proxy that sits between an AI agent and an OpenAI-compatible API. Replies come back as server-sent events. Text should reach the client the moment it arrives, but as soon as an event could carry a tool call, the proxy has to hold everything back until the whole reply can be checked. So every event goes through one question: is this event only text? If yes, its original bytes go out unchanged. From the first event that isn't (a tool call, a finish reason, an unknown field, anything…

What do people expect from a CLI in terms of documentation?

This is perhaps less rust related than should be asked here. If so, let me know and I'll post it elsewhere. I have been following the common advice that one of the better ways of learning a language is starting a project on it. Rust is the first programming language I've actually studied, so this has been some of my first exposure to more than just the language, I had barely used a terminal before, and this makes it very hard to know where people usually look for when learning a new CLI tool.…

Higher-rank trait bounds and `impl Default for Box>`?

I have a generic trait with a "default" implementation that I would like to use with Default::default (playground MWE): trait Trait<T> {} struct DefaultImpl; impl<T> Trait<T> for DefaultImpl {} I would like to use Box::new(DefaultImpl) as the default value for Box::new(dyn Trait<T>): impl<T> Default for Box<dyn Trait<T>> { fn default() -> Self { Box::new(DefaultImpl) } } This works OK until T is a reference with a higher-rank trait bound: // error[E0277]: the trait bound `Box<dyn for<'a>…

Enhance Return Type Notation

Opaque Type are an execellent design in Rust as it prevents users from relying on the specific return type of a function, especially useful in the context of compiler-generated Future state machines. Consider the following codes: trait Foo: Sized { async fn foo(); } Please note the following two facts: Foo::foo returns an impl Future<Output=()> object: The opaque type here prevents external codes to rely on the size of this state machine. Foo requires the object to be Sized: This makes Foo no…

Using clearscreen in Linux and Android (under Termux)

Hi folks; I am trying (unsuccessfully) to use the clearscreen crate / module under Android Termux. Rust is correctly installed (the following both work): rustc --version cargo --version in my expanded "hello.rs" I have tried: extern crate clearscreen; use clearscreen; and other variants. Clearsreen is in Cargo.toml. It appears that I am having a problem using extern crate <crate_name>; In my first actual program, I tried to use: extern crate chrono; In all cases I get "Crate not found" - even…

Bidirectional ESP-NOW communication in no_std Embedded Rust between a Raspberry Pi Pico 2 W (RP2350 RISC-V Hazard3 + CYW43439) and an ESP32-C3 Mini is now validated and benchmarked on real hardware

Using my cyw43-riscv stack built on Embassy, I ran a 1,000-exchange PING/PONG test over channel 1 with 8-byte payloads: • 1,000 / 1,000 matched PONGs (100.0% success rate, 0 errors, 0 timeouts) • 13.732 ms average round-trip time (RTT) • 12.648 ms minimum RTT and ~12.850 ms P50 latency (~14.250 ms P95) • Ready-to-compile examples for both Pico 2 W and ESP32-C3 Mini along with the full benchmark report included in the repository The screenshots below show the RISC-V Hazard3 firmware build and…

Why are IterMut iterator loops allowed to use aliasing &mut references?

Consider the following rust code: fn main() { let mut v = vec![1,2,3,4,5,6,7,8]; for elem in v.iter_mut() { *elem += 10; } println!("{:?}", v); } This code compiles and runs just as expected, adding 10 to each element of v. However according to my understanding of the borrowing and ownership rules, it seems to violate the rule disallowing aliased exclusive references (i.e. &mut references). My understanding is that in the body of the loop, both elem and the &mut [i32] passed to [i32]::iter_mut…

Do you think we should need a Express like easy backend framework in rust?

Like most of devs I also came from nodejs and that's why I am wondering if Rust users also think this is a need? I do vibecoded a express like backend framework for my own use but still because it's only me developing and checking all the edge cases it's not happening very fast. actually it's some other project on cargo I don't find the sources of it on github so i downloaded it from cargo itself then added lots of features into it and renamed it nitrox the github has the most updated code it…