今日已更新 222 条资讯 | 累计 40667 条内容
关于我们

标签:#Rust

找到 496 篇相关文章

AI 资讯

My adaptive memory stayed empty in production, and it wasn't a bug

I had a table in the database that was supposed to fill itself. Its job was to learn from failures : every time the system tried a variant of something and it didn't work, it saved it, to recycle later in another context where it might. A laboratory of failed attempts, piling up. In production it had zero rows . It had been deployed for days and hadn't saved a single record. Meanwhile a neighbouring table —another memory, the one that notes which work is already exhausted so as not to repeat it— was growing normally. The temptation is obvious: there's a bug in the write. I went looking for it, and it wasn't there. Zero rows isn't the same as a write error The path that saves into that table emits a warning if the write fails. I searched the logs for those warnings: zero . No write had failed. That's a fact, not an absence of one. If the path had been taken and had failed, it would have left a trace. Zero traces and zero rows fit only one explanation: the write path never ran . Not ran-and-failed. Didn't run. That's the difference between a real negative and a negative that was never put to the test, and they look the same unless you look for the positive control —something the log WOULD show if the path had been taken—. Without it, "healthy and quiet" and "dead" look identical. Two mechanisms starving each other Why didn't it run? Because of another mechanism, upstream, doing its job well. That system has a negative memory : when it exhausts everything it knows how to try against a target, it notes it down, so as not to spend effort again on something it already knows won't pay. It's a sensible optimisation. But it sat before the phase that generated new variants —the phase that, on failing, would have fed the library—. As soon as a target went "exhausted", that phase was skipped entirely . And if the phase never runs, it never produces a failure to save. Each mechanism, on its own, is correct. The negative memory avoids useless work. The library learns from failure

2026-09-08 原文 →
AI 资讯

The descriptor survived, const did not — full-stack Rust

One skeleton, many screens argued that admin screens should be declared as typed data rather than coded, and it ended by claiming the idea was independent of the stack: draw the boundary as a one-way dependency — domains depend inward on a framework that knows nothing about them — and validate it with a zero-diff refactor of a screen you already trust. That was React and TypeScript. This is the same claim re-run in Rust, where a descriptor can be a compile-time constant and a template is a macro. Because the first result is already published, the second stack is a replication with a control rather than a fresh opinion — which is rare enough to be worth doing properly. Companion to Topcoat and the shrinking cost of full-stack Rust . That post was written from the announcement and promised a follow-up reporting where the rough edges actually show. This is it, from the pilot that followed: a small admin panel built on Topcoat 0.6.2 and Toasty 0.10.0, and the four questions that post committed to answering. The pilot is open source — a clean clone runs both screens and the test that decides the argument. That phrase, a compile-time constant , is where the title comes from, so it is worth saying now what it buys and why I wanted it. A TypeScript descriptor is an array of objects assembled when the module loads. A Rust one can be more than that: &'static , Copy , allocated never, fully checked before the program starts. Going in, that looked to me like the same idea in a stricter form — if declaring a screen as data is good, then declaring it as data the compiler can see through and verify must be better still. I treated that property as the thing worth protecting, and the pilot was partly a test of whether it could be. The stack is deliberately a young one. Topcoat is six weeks old: Tokio's team announced it on 22 July 2026, the pilot pins 0.6.2, and the project still expects breaking changes. It is not the only full-stack Rust framework — Leptos and Dioxus have been at

2026-09-07 原文 →
AI 资讯

10 Essential Tools I Actually Use to Keep My Side Projects From Falling Over

Docker management, monitoring that goes deeper than a green dot, backups I have actually restored, and everything else that showed up once deploying stopped being the hard part. Moving off Vercel solved exactly one problem: deploying. Everything else I used to get for free, quietly, as part of the platform, I now had to go find and wire up myself. A month into running my own server, I had a list of ten tools taped to the inside of my head, each one solving a problem I did not know I had until it happened to me at a bad time. This is that list, in the order I actually needed them, with the mistake or the moment that made me install each one. I lean JS and Rust wherever I can, partly out of preference and partly because those are the tools that keep pace with how fast the rest of my stack moves. A couple of these are not JS or Rust at all, and I kept them anyway because they were simply the best tool for the job. 1. Dokploy, for everything I wrote about yesterday This is the one I already spent an entire post on, so I will keep it short here. Push to main, Dokploy builds the container, Traefik points a domain at it, done. Four apps running on one $24 droplet, and adding a fifth would not move the bill. If you deploy anything with Docker and are still doing it over SSH, start here. Everything else on this list assumes you already have a platform under you, not just a server. 2. Neon, for the database half of preview environments The first crack after Dokploy was previews. Dokploy gives every pull request its own preview URL, which is one of the nicest things about the whole setup, right up until every preview hits the same production database. I corrupted a batch of test data twice before I noticed what was happening. Neon branches Postgres the way git branches code, copy-on-write, so a preview PR gets its own preview database that costs almost nothing until it actually diverges from main. The storage engine underneath is written in Rust, and it quietly closed the othe

2026-09-06 原文 →
AI 资讯

I Rewrote My Electron App in Tauri — and Claude Did 100% of the Work in Under 24 Hours 🚀

TL;DR 📌 🕰️ Then: I built google-chat-electron by hand , over months , reading tutorial after tutorial. ⚡ Now: I rebuilt the whole thing as google-chat-tauri in less than 24 hours — and I did not write the code. Claude did. 🦀 Plot twist: I don't know Rust. Not a little — at all . The AI wrote every line of it. 📦 Result: a ~ 3 MB Linux installer instead of a bundled Chromium. 🧪 Status: pre-release. Fun project. Stable version coming after real-world testing. Let's dive in. 👇 The Electron Era: Months of Honest, Manual Labour 😅 A few years ago I wanted Google Chat in a real window — with a tray icon, an unread badge and native notifications — instead of a browser tab that disappears among thirty other browser tabs. So I built it. In Electron. By hand. And it took months . Not because Electron is bad, but because every single thing was a tutorial: How do I make a tray icon that actually behaves? How do I keep the app alive when the window closes? How do I intercept a link and open it in the real browser? How do I package a .deb ? A .dmg ? An installer for Windows? Why does this work on my machine and nowhere else? 🙃 Every answer was a blog post, a GitHub issue thread, or a Stack Overflow reply from 2017 that almost applied. It shipped, people used it, and I was genuinely proud of it. The Tauri Rewrite: One Evening, One Prompt Loop 🤖 Last week I opened Claude Code and asked it to port the app to Tauri v2 . I did not open the Rust book. I did not read the Tauri docs. I described what the app should do, reviewed what came back, ran it on my actual laptop, and reported what broke. Timeline: Time What happened 15:42 git init 17:01 Full Electron → Tauri v2 port committed 17:25 Desktop notifications working < 24h later v0.0.1 tagged and released 🎉 38 commits. ~3,600 lines of Rust and JavaScript. Zero lines typed by me. This is what people mean by vibe coding — and honestly, it felt less like programming and more like directing . My job became: describe the behaviour, test it on

2026-09-06 原文 →
AI 资讯

Fifty seconds for half a megabyte: the optimisation that fixed the constant, not the order

A cryptography library had a bottleneck no test could see : encrypting half a megabyte took fifty seconds. Every test passed. They had been passing for months. The cause is a trap that keeps recurring: a correct, well-documented optimisation that fixes the constant and not the order — and whose comment, precisely because it is well written, convinces the reader the problem is already solved. What the code did Quipu renders encrypted data as a sequence of symbols. To do that it converts the whole message into a single huge integer and repeatedly divides it to extract digits, the same way you would convert a base-10 number to base 2 by hand. The code did not divide one digit at a time. It carried a sensible optimisation: divide by the largest power of the base that fits in a machine word, extracting nine digits per pass instead of one. The comment explaining it opened by saying that doing it one at a time would be quadratic , and then described the improvement. All true. And the result was still quadratic: extracting nine digits per pass divides the work by nine; it does not change how the work grows. That sentence — "doing it this way would be quadratic" — reads in the past tense, as if it described the previous state. It described the current one. The measurement, which is the only thing that says so Size Time Factor per doubling 64 KiB 0.79 s — 128 KiB 3.16 s ×4.0 256 KiB 12.6 s ×4.0 512 KiB 50.7 s ×4.0 Exactly four, three times running. That is textbook quadratic: every time the input doubles, the time quadruples. Extrapolating, ten megabytes would have cost about five and a half hours . And here is the point: a correctness test sees none of this . A slow algorithm produces exactly the same bytes as a fast one. The suite stayed green, and would have stayed green forever. The fix is two hundred years old Nothing had to be invented. Divide-and-conquer radix conversion is a classical algorithm: instead of peeling digits off one end, you split the number in half — div

2026-09-06 原文 →
AI 资讯

AI Coding Agents Are Installing Unknown/Untrusted Code on Corporate Networks

We cannot forget that AI coding agents are not yet trustworthy : Researchers at a stealth startup in Israel scanned 6,214 live domains belonging to defense contractors, Fortune 500, and Big Tech companies. Of the 8,265 llms.txt and llms-full.txt files they found (many sites hosted both an llms.txt and an llms-full.txt file), 120 of them, each on a different site, pointed to one or more code packages or domain names that weren’t registered. To test what happens when an AI agent processes such files, the researchers registered a handful of the unclaimed names and hosted packages that caused any machine executing them to reach out to their server. Within an hour, the researchers received a phone-home response from a Fortune 500 company. Over time, they got a few dozen more, some from more Fortune 500 companies and others from startups. Their beacon also recorded the chain of parent processes that spawned each install, ultimately revealing that coding agents, including Claude, OpenAI’s Codex, and Nous Research’s Hermes, were involved. Anthropic, OpenAI, and Nous Research did not respond to requests for comment by the time of publication...

2026-09-04 原文 →
AI 资讯

# How enabling cross-origin isolation silently broke our multi-threaded WASM image compressor

A production postmortem. We shipped browser-side image compression (Rust → WASM + WebGPU), turned on cross-origin isolation for speed, and watched every format crash with compression worker crashed . Here's the root cause and the fix. The setup We built an image compressor that runs 100% in the browser — Rust compiled to WASM for the codec work, WebGPU for the heavy ML passes (background removal, denoise, watermark). No upload, so users' pixels never leave the device. Privacy is the whole selling point. For the multi-threaded code paths we rely on shared memory + atomics , which in the browser requires crossOriginIsolated . So we served the document with: Cross-Origin-Embedder-Policy: require-corp Cross-Origin-Opener-Policy: same-origin That gives us crossOriginIsolated === true , unlocks SharedArrayBuffer , and lets the *‑threaded WASM builds actually spawn workers. The build uses a nightly toolchain ( nightly-2025-06-01 + -Z build-std ) with: RUSTFLAGS = "--cfg=... +atomics,+bulk-memory --shared-memory --import-memory" and a custom rayon handle pool ( with_turbo_pool ) instead of build_global , so we control worker lifecycle and can abort/self-heal. The incident After flipping COEP to require-corp in production, every format started crashing with the same message: compression worker crashed Not one codec — JPG, PNG, WebP, AVIF, all of them. It was a P0: the core feature was dead for every user. What made it nasty: it only reproduced under real cross-origin isolation . Local dev without COEP was fine. Staging without the header was fine. So the bug hid until it hit production traffic. Root cause The *‑threaded WASM packages spin up nested rayon workers to parallelize the codec. Under COI + COEP require-corp , those nested workers get blocked by Cross-Origin-Resource-Policy / COEP — the spawned worker script is treated as a cross-origin response without the right CORP header, so the browser refuses it. No worker → the rayon pool never initializes → the compression c

2026-09-04 原文 →
AI 资讯

Why `rustdesk/rustdesk` Is Trending on GitHub: A Self-Hostable Remote Desktop Stack

RustDesk is gaining attention today with +84 GitHub stars , and the reason is straightforward: it provides an open-source remote desktop experience while allowing teams to control the infrastructure behind it. Unlike a client-only tool, RustDesk is built around a self-hosting model. The desktop client connects through a RustDesk ID server ( hbbs ) for rendezvous and a relay server ( hbbr ) when direct peer-to-peer connectivity is unavailable. This separation makes the architecture easier to reason about and gives operators more control over traffic and metadata. A quick server experiment can start with Docker: docker run -d \ --name rustdesk-hbbs \ --network host \ -v " $PWD /rustdesk-data:/root" \ rustdesk/rustdesk-server:latest \ hbbs docker run -d \ --name rustdesk-hbbr \ --network host \ -v " $PWD /rustdesk-data:/root" \ rustdesk/rustdesk-server:latest \ hbbr For production, configure the client with your server’s public key and hostname rather than relying on default discovery. Keep the relay and rendezvous ports documented, restrict administrative access, and store the generated keys in a protected location. The Rust implementation is a practical fit for a latency-sensitive desktop application: native binaries, low runtime overhead, and broad platform support. The trade-off is operational complexity. Self-hosting means handling updates, firewall rules, TLS or tunnel termination, backups, and monitoring yourself. Things to watch before production: Network design: Direct connections may fail behind strict NAT, forcing traffic through the relay and increasing bandwidth usage. Security controls: Treat the server key, access credentials, and client distribution process as sensitive infrastructure. Upgrade testing: Validate client/server compatibility in a staging environment before rolling out updates widely. For developers who want remote support without surrendering control of the entire connection path, RustDesk is a compelling open-source project to test in a p

2026-09-04 原文 →