Getting Started with Rust on Replit
Replit's browser IDE can host a ready-made Rust workspace, demonstrated here with a small Cargo project built in one. The project implements binary search in src/lib.rs, runs an Exercism-derived test suite with cargo test, and parses user input with Result/match. It then adds the bunt crate for colored console output and uses Replit's bundled key-value database via REPLIT_DB_URL. Along the way it explains basic Rust concepts such as borrows, Option, mut, if-as-expression and if let.
Related posts
- Rewriting the CLI in Rust: Was It Worth It?
Railway mediumAdeptRailway rewrote its Go/Cobra CLI in Rust for v3 because the old codebase had untyped, string-defined GraphQL queries, dynamically registered flags that forced ~120 error guards, and assumptions predating multi-service projects. The Rust version uses clap derive structs with one file per command, a commands_enum! macro to generate the subcommand enum, and schema-validated GraphQL types against the new Public API. User-facing gains include tables, fuzzy-select menus via inquire, a global --json flag and automatic non-interactive mode in CI. The hardest part turned out to be cross-platform release CI and install scripts, and the rewrite broke some users' CI along the way.
- Building Ghostwriter Chat
Replit easyNoviceGhostwriter Chat embeds an LLM-powered assistant directly in the Replit IDE, using file context, chat history and program output so users never copy-paste into a separate tool. Streaming generated tokens keeps time-to-first-token under 500 ms and lets users abort unhelpful answers. A generic prompt-construction layer gathers context from varied sources and renders it for different model APIs. To fit token limits, it drops older chat messages, caps user messages at 500 characters, and favors recently edited source files over noise like .venv, linter and CI configs.
- Introducing the Replit Desktop App
Replit mediumAdeptReplit now ships a native desktop app for macOS, Windows and Linux, centered on the IDE workspace, with multiple windows, editor shortcuts the browser would intercept (Cmd/Ctrl+T/W), deep linking and native Chromium devtools. It is built on Electron rather than React Native, which lacked Linux support, or Tauri, which was missing deep linking and native APIs for remotely loaded URLs and brought cross-platform rendering differences and Rust iteration costs. The app remotely loads part of the website, exposes Node APIs to the web client, and is packaged and signed per platform and architecture with Electron Forge in GitHub Actions. Auto-updates go through a Hazel-based release server deployed on Replit.
- AI Agent Code Execution API
Replit mediumAdeptReplit offers sandboxed code execution so LLM agents can run untrusted generated code, contrasting a stateless model (like Bard's implicit code execution for math) with a stateful, session-long project environment (like ChatGPT). The stateless option is a forkable API server on Replit Autoscale Deployments, using the omegajail unprivileged container sandbox with a customizable Docker image, handling requests in as little as 100ms and integrating with OpenAI function calling via the replit-code-exec package. A stateful prototype using a full Repl as sandbox was tried and then discontinued, with code-exec recommended for most use cases.
- The Debugger is Here
Zed mediumAdeptZed now ships a native debugger built on the Debug Adapter Protocol, with out-of-the-box support for Rust, C/C++, JavaScript, Go and Python. "Locators" turn build tasks such as Cargo runs into debug configurations automatically. Internally it uses a two-layer design: a data layer talks to debug adapters, caches responses by request arguments, lazily fetches and invalidates stale state, and a UI layer queries only what it renders, which sets up future collaborative debugging. Extensions can plug in any of the 70+ DAP implementations, and inline variable values come from Tree-sitter scope queries rather than the LSP inline-values request.