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

标签:#rust

找到 309 篇相关文章

AI 资讯

My Solana Program Launch Checklist (Written the Day After I Actually Did It)

Three weeks from now I will open a terminal, ready to ship another program to mainnet-beta, and I will pause. What was the order again? Did the IDL go up before or after the authority transfer? Was there a flag that saved me from a stalled deploy last time? This checklist exists because I just walked the entire path devnet to mainnet, deploy to IDL to frontend to error handling, and I wrote it down while the details are still fresh. It is the document I wish I had on day one of that process. Run it top to bottom before every mainnet launch. Why a checklist at all? A Solana mainnet deploy is full of irreversible steps. The wallet that signs the deploy quietly becomes the program's upgrade authority. A buffer account left mid-deploy can strand real SOL. A plain anchor build after a verifiable build can produce a different hash and break verification later. None of these are complicated. They are all easy to forget under pressure. A checklist is not a crutch; it is the habit that lets you ship calmly instead of improvising each time. Phase 1: Pre-flight on devnet Do all of this while mistakes are still free. [ ] Every test passes against the final build. Run anchor build && cargo test --package <your-program> one last time. The binary you test must be the binary you ship. [ ] End-to-end run on devnet. Call every instruction through the actual frontend, not just the test suite. The frontend is a different caller than LiteSVM and will surface different failure modes. [ ] Produce a verifiable build. Run anchor build --verifiable . This pins the build environment so the on-chain bytecode can later be matched to your source code. Once you have this artifact, do not touch it with a plain anchor build or cargo build-sbf ; those can produce a different hash and silently break verification. [ ] Measure rent before you spend it. Run: solana rent $( wc -c < target/deploy/.so ) Your deploy wallet must hold this amount plus a margin for transaction fees. There is no airdrop on the

2026-07-19 原文 →
AI 资讯

How I make ffmpeg hit an exact file size (the bitrate math nobody explains)

Every few weeks I hit the same wall: I have a 300 MB screen recording, and something on the other end wants it under 8 MB . Discord, an email attachment, a bug tracker, a form that silently rejects anything bigger. The usual advice is "just use HandBrake" or "run ffmpeg with a lower CRF." But CRF doesn't take a target size — it takes a quality knob . So you export, check the size, it's 11 MB, nudge the knob, export again, now it's 5 MB and looks like a potato, nudge back… It's a binary search you run by hand, one full encode per guess. The thing is, hitting an exact size isn't a guessing game at all. It's arithmetic you can do before you encode. I ended up wrapping that arithmetic into a little Rust CLI ( DeepShrink ), but the math is the interesting part, and almost nobody writes it down. So here it is. The one insight everything rests on File size is (roughly) bitrate × duration . A bitrate is bits per second. A duration is seconds. Multiply them and the seconds cancel, leaving bits — the size of the file. That's it. That's the whole trick. Normally you treat bitrate as the input and size as whatever falls out. Flip it around: fix the size, measure the duration, and solve for the bitrate. You know the duration (ffprobe will tell you), and you know the size you want (the platform's limit). The only unknown is the bitrate — and now it's a single division away. bitrate = size_in_bits / duration_in_seconds Everything below is just this equation with the real-world messiness added back in. Building the budget, step by step Say I want a 60-second clip to fit Discord's 8 MB limit. 1. Turn the target size into bits. Sizes are in bytes, bitrate is in bits, so multiply by 8. (I'll use 1 MB = 1,000,000 bytes here to keep the mental math clean; if your platform means mebibytes, same method, different constant.) target_bits = 8_000_000 bytes × 8 = 64_000_000 bits (64 Mbit) 2. Reserve a little for container overhead. An .mp4 isn't pure video and audio — there's a container, a m

2026-07-19 原文 →
AI 资讯

Clear the Lineup — Chasing a Stack Overflow in Typst's `#eval` Down to One Wrong Word

This is a submission for DEV's Summer Bug Smash: Clear the Lineup . Project Overview Typst is the Rust-based markup typesetting system that's been quietly eating LaTeX's lunch for the last couple of years — you write plain-text markup, Typst compiles it to PDF (or HTML) with a real incremental compiler underneath instead of a multi-pass macro soup. Part of what makes it pleasant is that it exposes its own evaluator to itself: a document can call #eval("some typst code") and get back whatever that code produces, at runtime, inside the document being compiled. It's a small feature, but it opens up a surprisingly deep rabbit hole, which is exactly where this bug was hiding. Bug Fix or Performance Improvement The problem: typst/typst#8632 reports that Typst crashes instead of erroring when #eval is used to recursively re-import the file it's running in. The repro is one line. Save this as overflow.typ : #eval("import \"overflow.typ\"") Then: $ ./target/debug/typst compile overflow.typ overflow.pdf thread 'main' (750833) has overflowed its stack fatal runtime error: stack overflow, aborting No PDF, no diagnostic, no exit code you can act on — just a native stack overflow and a SIGABRT. Typst has had cyclic-import detection since forever; a normal top-level import "overflow.typ" inside itself gets caught cleanly with an error: cyclic import message. Something about routing the import through #eval specifically was bypassing that check. The hunt I'll be upfront about how this investigation actually went: I worked through it with Claude (Anthropic's coding agent) rather than solo. The triage pass it did before I sat down with the code had already narrowed the search to one function — eval_string in crates/typst-eval/src/lib.rs — and named the suspect line. That's a big head start, but a named suspect isn't a confirmed root cause, so the actual work was reading that function next to its sibling, the file-level eval() a few lines above it, and checking the claim against the s

2026-07-18 原文 →
AI 资讯

I Built a Rust Data Engine That Can Prove Its Own Results

Most data engines can answer a query. I wanted one that could also explain, offline and byte for byte, why that answer belongs to a specific durable state. That question led me to build Hyphae , an open-source data engine in Rust with a deliberately small operational footprint: one native binary; one data directory; no required database, cache, cloud service, embedding provider, or LLM; deterministic KV and structured queries; portable result proofs that can be verified offline. If you read my earlier post about provenance over prediction , this is the next and deliberately narrower step. That work began as a cognitive substrate and clarified the provenance thesis. I have since rebuilt Hyphae as a standalone data engine. The research lineage remains, but the current product does not need an AI stack to be useful. Hyphae 0.1.0 is now available on GitHub , through crates.io, and as signed multiplatform archives in the first public release . The problem was not another query syntax The usual path for an application data feature grows surprisingly quickly. A local library becomes a database service. Search adds another service. Caching adds another. Semantic retrieval adds a model provider. Soon, a feature that should be optional controls whether the application can start at all. There is a second problem hiding underneath that operational stack: a successful response is usually just an assertion from the system that produced it. If I receive a filtered, sorted, limited result, how do I check that: the underlying durable state was not corrupted; the query was executed with the declared semantics; matching rows were not silently omitted; the returned result is tied to the state I actually intended to trust? Checksums help with corruption. Signatures can identify a producer. Neither one, by itself, proves that an arbitrary query result is complete and was reexecuted correctly. Hyphae is my attempt to make those concerns part of the engine instead of application glue. What

2026-07-17 原文 →
AI 资讯

Presentation: The Rust High Performance Talk You Did Not Expect

Ruth Linehan explains how migrating high-performance caching services from Kotlin to Rust shattered internal preconceptions around delivery velocity and engineering overhead. She discusses the ergonomics of the Rust borrow checker, shares how compile-time safety shortens the developer feedback loop, and profiles how tools like Criterion and flamegraphs optimize concurrent code paths. By Ruth Linehan

2026-07-16 原文 →
AI 资讯

Brendan Carr plans to let broadcast giants dominate the airwaves

The Federal Communications Commission will vote next month on whether a single company can own broadcast stations that reach more than 39 percent of US TV households. In a Breitbart op-ed on Wednesday, Republican Chair Brendan Carr announced an August 6th vote to end the national ownership cap rule, which was intended to prevent one […]

2026-07-16 原文 →
AI 资讯

The Future of Rust: Dominating Systems Programming in 2026

The Future of Rust: Why This Memory-Safe Language is Dominating Systems Programming in 2026 In its early years, Rust was often viewed as a "rising star"—a promising language with significant potential but a steep learning curve. As we navigate through 2026, that narrative has fundamentally shifted. Rust has transitioned from a niche interest to a cornerstone of modern, memory-safe infrastructure. The language is no longer just proving its worth; it is defining the gold standards for systems programming, cloud-native backend services, and kernel development. This deep dive explores the key pillars driving Rust's evolution, its massive ecosystem growth, and the roadmap for the years ahead. Seamless Ownership: The New Era of Rust Ergonomics One of the most significant shifts in recent Rust development has been the relentless focus on language ergonomics. Historically, developers occasionally felt that custom smart pointers were "second-class citizens" compared to built-in references. The "Beyond the & " initiative has successfully bridged this gap. Through advancements in Smart Pointer Parity , developers can now use custom pointers—such as Rc , Arc , or specialized interop pointers—with the same intuitive syntax and capabilities as standard references. Furthermore, the introduction of sophisticated field projection mechanisms and &own references allows for unprecedented precision in managing ownership and borrowing. This makes complex data structures much easier to implement and reason about, drastically reducing the friction typically associated with high-level abstractions. The Async Revolution: Making Asynchronous Code Natural Rust has achieved a milestone often referred to as "Async Parity," aiming to make asynchronous programming feel as natural and seamless as synchronous code. Several key developments have fueled this revolution: Async-in-Traits: The stabilization of async fn in traits has removed the need for external crates like async-trait , greatly simplify

2026-07-16 原文 →
AI 资讯

Reverse-engineering an MMO Aion 2's network protocol to build a real-time DPS meter (Rust + Tauri)

Disclosure: this is a write-up about my own side project — a combat analytics tool for AION 2. No affiliation with the game's publisher. Links at the end. Architecture A Windows desktop app: Rust backend + Tauri v2 webview UI . It passively captures the game's TCP traffic (npcap), reassembles streams, parses the game's undocumented binary protocol, feeds a combat model (damage, heals, buffs, deaths, boss detection), and pushes aggregates to a small JS frontend. Nothing touches the game client — no injection, no memory reading. If the packet didn't say it, we don't know it. Pain #1: the protocol is a moving target Nobody hands you a spec. The protocol is varint-heavy, partially compressed, and changes with game patches. You end up doing packet archaeology: capture a fight, stare at hex dumps, correlate "I pressed this skill at 19:32:04" with byte patterns, build a parser, and then — the fun part — keep it alive after every patch , usually reverse-engineering the diff within hours because your users' raids are tonight, not next week. One hard-won lesson: log everything behind toggleable trace categories. Our tracing setup keeps hot-path log callsites at literally zero cost when disabled (Rust tracing with Interest::never() + atomic per-category flags), so a user can flip a "Trace: Packets" checkbox, reproduce a bug, and send a log that actually contains the bytes we need. Pain #2: entity identity is a lie The single hardest correctness problem wasn't parsing — it was identity . A player is not one ID: your character has a stable "owner" entity that carries your buff bar, your damage lands under a transient combat entity whose ID changes between pulls, leave the dungeon and the game re-binds you to a brand-new ID, names arrive from different packets than damage, sometimes seconds later, sometimes never (mid-fight app start). Get any of this wrong and a healer's healing lands on a ghost row, or a player's buffs vanish from the saved fight because their ID was recycled 7

2026-07-16 原文 →
AI 资讯

pinto: A Git-Native Scrum Backlog and Kanban Board for Your Terminal

pinto lets teams manage Scrum backlogs as plain text. Every backlog change can be inspected with git diff , carried across a branch, merged, and reviewed in a pull request—just like source code. The backlog follows the same lifecycle as the product it describes. pinto is local-first: no server, account, or hosted database is required. It works with AI agents, but never depends on them. And unlike a generic CLI to-do list, its core model is Scrum: Product Backlog Items (PBIs), Sprints, Kanban, and the metrics teams use to inspect and adapt. Why pinto exists Jira, Asana, and Notion are capable products. But as more features accumulate, the process can start serving the tool instead of the other way around: Creating one ticket means navigating required fields and workflow settings. Running a Sprint begins with configuring permissions, automations, or dashboards. Even a small status change feels expensive when the tool is slow to open. Scrum is meant to be a lightweight framework for rapid inspection and adaptation . When maintaining the board becomes work in its own right, the tooling has lost sight of that goal. The name pinto comes from the Japanese word ピント “focus.” That is also the design intent: keep the team's attention on the Product Backlog, the Sprint, and the work flowing across the board. pinto deliberately stays small. It starts quickly, keeps dependencies and vocabulary limited, stores durable data as readable files, and excludes project-suite features such as Gantt charts and CRM. Your backlog belongs in the repository Running pinto init creates a .pinto/ directory beside your code. Each PBI is a Markdown file with TOML frontmatter. Here is a real item from pinto's own backlog: +++ id = "P-2" title = "Investigate and fix Windows CI while retaining Windows support" status = "done" rank = "j" labels = ["ci", "windows"] created = "2026-07-15T06:24:58.731847Z" updated = "2026-07-15T09:34:50.653786Z" +++ # Summary Investigate, verify, and fix the current Windo

2026-07-16 原文 →