英语轻松读发新版了,欢迎下载、更新

Node.js frustrating and inefficient? OpenAI rewrites AI coding tool in Rust • DEVCLASS

2025-06-02 16:31:44 英文原文

作者:Tim Anderson

Node.js frustrating and inefficient? OpenAI rewrites AI coding tool in Rust

OpenAI has rewritten its forthcoming AI command-line coding tool, Codex CLI, in Rust, citing gains in performance and security, as well as avoiding dependence on Node.js which can be “frustrating or a blocker for some users.”

Codex is an experimental coding agent which runs either from a web browser within ChatGPT, or locally using Codex CLI. It has a chat-based user interface and the CLI runs either interactively, with prompts prefaced by the codex command, or in a non-interactive quiet mode that can be used in continuous delivery pipelines, for example to generate a changelog. The current Codex is not to be confused with a 2021 product also called Codex but which was deprecated in March 2023.

Codex CLI is open source on GitHub and runs on MacOS, Linux, or Windows via WSL (Windows Subsystem for Linux). The source code is largely TypeScript and runs on Node.js, but the team has now created a rewrite in Rust. Bugfixes will still be merged for the TypeScript implementation at least until the Rust version is at “experience and feature parity,” said maintainer Fouad Matin.

Why the rewrite? Matin said that although the current React and TypeScript-based version had been “easy to whip up and interate,” there are four key reasons why Rust will be an improvement.

  • The first is zero-dependency install, whereas the current requirement for Node.js 22 or higher can be a blocker for some users.
  • Second is the need for sandboxing. On macOS, Codex CLI has its commands wrapped by Apple Seatbelt, a command called sandbox-exec which runs processes in a configurable sandboxed environment. On Linux Codex CLI is not sandboxed by default and OpenAI recommends running it in a container. OpenAI though has already created a way of sandboxing Rust commands, still using sandbox-exec on macOS, and on Linux using Landlock [https://docs.kernel.org/userspace-api/landlock.html].
  • Third is optimized performance, with no runtime garbage collection and lower memory requirements. 
  • Fourth is the ability to use an existing Rust implementation of MCP (Model Context protocol). Codex CLI will be able to function both as an MCP client and an MCP server.

Rust was designed as a system language and is inherently more efficient than code running on the V8 JavaScript engine used by Node.js. The trade-off though is that programming Rust is more difficult and therefore arguably less productive than writing TypeScript or JavaScript. JavaScript and Python are the most popular programming languages according to most surveys, whereas Rust is much less well-known. The Rust-based Codex CLI will still be extensible with code in other languages including JavaScript and Python though details of this are not yet available.

OpenAI is not the only organization to decide that the efficiency of Rust is worth the extra effort. Vue.js creator Evan You has posted about the introduction of Rolldown-Vite, a new version of the Vite local development server and build tool. Vite currently uses a bundling tool called Rollup.js under the covers, but replacing this with the Rust-based Rolldown achieves “production build time reductions from 3x to 16x, and memory usage during the build process cut by up to 100x,” said You.

关于《Node.js frustrating and inefficient? OpenAI rewrites AI coding tool in Rust • DEVCLASS》的评论


暂无评论

发表评论

摘要

OpenAI has rewritten its experimental coding tool Codex CLI in Rust to improve performance and security, and to reduce dependency on Node.js, which can be a barrier for some users. The new version is designed to work without dependencies, offer better sandboxing capabilities, provide optimized performance with lower memory requirements, and utilize an existing Rust implementation of MCP. The TypeScript-based version will continue to receive bug fixes until the Rust version matches its features and user experience. OpenAI joins other organizations recognizing Rust's efficiency for complex development tasks.