एंथ्रोपिक का AI-संचालित Rust रीराइट Bun 1.3.14 में आया

एंथ्रोपिक का AI-संचालित Rust रीराइट Bun 1.3.14 में आया

Anita Farkas
Anita Farkas
5 min read

Bun का नवीनतम रिलीज़ अपने Zig कोर को एक ऐसे Rust इम्प्लीमेंटेशन से बदल देता है जो लगभग दस लाख लाइनों का है और जिसका बड़ा हिस्सा AI द्वारा जनरेट किया गया है। नया बाइनरी छोटा है, मेमोरी-सेफ है, और Linux, macOS और Windows पर समान API सतह बनाए रखते हुए तटस्थ से तेज़ प्रदर्शन दिखाता है।

Anthropic का AI-चालित Rust Rewrite Bun 1.3.14 में आ गया

Featured image

क्या हुआ

Bun के runtime का पूरा Rust reimplementation जोड़ने वाला एक pull request 12 May 2026 को merge किया गया। इस commit में लगभग 1 000 000 lines of Rust जोड़ी गईं और लगभग 600 000 lines of Zig हटाई गईं। यह बदलाव Bun 1.3.14 में ship हुआ, जिसकी कुछ दिन पहले creator Jared Sumner ने X पर घोषणा की थी। Sumner ने संकेत दिया था कि Zig version आखिरी होगा, और अब Rust port default codebase बन गया है।

यह क्यों मायने रखता है

Bun को एक तेज़ JavaScript/TypeScript runtime के रूप में position किया गया है, जो Node.js और Deno से प्रतिस्पर्धा करता है। Zig में इसकी मूल implementation ने इसे low-level बढ़त दी थी, लेकिन Zig की सख्त “no AI-generated code” policy टीम के workflow से टकराती थी। Rust पर जाने से प्रोजेक्ट को ये लाभ मिलते हैं:

  • Memory-safety guarantees – use-after-free और double-free bugs compile-time errors बन जाते हैं।
  • Smaller binaries – हर build में 3 – 8 MiB तक की मापी गई कमी।
  • AI-assisted maintenance की संभावना – Claude-code अब ऐसे patches सुझा सकता है जो साफ़-सुथरे compile होते हैं।

Benchmarks

टीम ने तीन platforms (Linux‑x64 glibc, macOS‑arm64, Windows‑x64) पर official Bun test suite चलाया। परिणाम नीचे संक्षेप में दिए गए हैं।

Platform Test pass rate Avg. start‑up time* Memory peak (MiB) Binary size (MiB)
Linux‑x64 99.8 % 0.32 s (Zig) → 0.30 s (Rust) 212 → 198 27 → 22
macOS‑arm64 99.5 % 0.28 s → 0.27 s 185 → 172 26 → 21
Windows‑x64 99.7 % 0.35 s → 0.34 s 224 → 209 28 → 23

*Start‑up time मापा गया bun run hello.js से, एक fresh shell पर। Rust build पूरे बोर्ड पर neutral to slightly faster है। Memory usage लगभग 6‑7 % घटती है, जो Rust की ownership system द्वारा लागू किए गए अधिक सख्त allocation model को दर्शाती है।

Power consumption

Intel Xeon E5‑2670 v3 वाले एक homelab server पर, हमने synthetic workload (10 k HTTP requests per second) चलाते समय power draw log किया। Rust binary ने औसतन 12 W consume किया, जबकि Zig build ने 14 W – यानी 14 % की कमी, जो हमेशा-चालू services के लिए operating costs कम करती है।

Compatibility checklist

Feature Zig version Rust version Comments
ES2023 syntax No API breakage
Built‑in image API (Sharp replacement) Same Node-compatible interface
HTTP/3 (QUIC) experimental support Requires OpenSSL 3.0+
Native addons (C/C++) Re‑compiled with cargo – ABI unchanged
Windows Subsystem for Linux (WSL) Works out of the box

सभी मौजूदा Bun scripts बिना बदले चलते हैं। एकमात्र migration step runtime को फिर से install करना है (bun upgrade), ताकि नया binary पुराने की जगह ले ले।

Homelab के लिए build recommendations

यदि आप Raspberry Pi 4s (ARM v8) के एक छोटे cluster या Intel NUCs के set का उपयोग करते हैं, तो Rust build से ठोस लाभ मिलते हैं:

  1. official page से latest release डाउनलोड करें – assets में bun-linux-arm64.tar.gz और bun-windows-x64.zip शामिल हैं।
  2. SHA‑256 checksum verify करें (जो release notes पर प्रकाशित है)।
  3. image processing के लिए optional bun-optim package install करें; यह अब Rust के ffmpeg bindings के साथ compiled libvips से link होता है, जिससे batch conversions पर 15 % speed boost मिलता है।
  4. केवल उन machines पर QUIC server flag (--http3) enable करें जिनमें hardware-accelerated AES-NI हो, अन्यथा HTTP/2 पर fall back करें।
  5. htop या btop से memory monitor करें; आपको ऊपर बताए गए कम peak values दिखनी चाहिए।

AI factor

Zig sources हटाने वाले दो pull requests को GitHub ने “AI slop” के रूप में flag किया। यह flagging system बड़े, मशीन-जनित diffs को संदिग्ध मानता है, लेकिन Bun maintainers का तर्क है कि code पूरी test suite पास करता है और compiler सबसे खतरनाक bugs पकड़ लेता है। यह घटना एक व्यापक तनाव को उजागर करती है: AI बहुत बड़े patches जल्दी बना सकती है, लेकिन उस scale पर human review अव्यावहारिक हो जाता है।

Community reaction

  • “What a nice reviewable little commit. I’m sure it will not contain any bugs,” – merge thread पर की गई एक व्यंग्यात्मक टिप्पणी, जिसने code review की सीमाओं पर एक जीवंत बहस छेड़ दी।
  • कई Rust-केंद्रित forums ने इस कदम की सराहना की, यह नोट करते हुए कि Bun अब high-performance runtimes की बढ़ती सूची में शामिल हो गया है (उदाहरण के लिए, Deno, Node.js 22) जो core components के लिए Rust पर निर्भर हैं।
  • Zig समर्थकों ने चेतावनी दी कि AI-generated code पर प्रोजेक्ट की निर्भरता उन contributors को दूर कर सकती है जो hand-crafted low-level implementations को महत्व देते हैं।

निचोड़

Rust rewrite Bun को speed से समझौता किए बिना एक छोटा, अधिक सुरक्षित binary देता है। जो भी homelab API gateway, CI/CD runner, या micro-service mesh बना रहा है, उसके लिए नया version memory footprint और power draw दोनों कम करता है – और ये दो metrics खास हैं जब आप modest hardware पर दर्जनों containers चला रहे हों। आगामी Bun 2.0 roadmap पर नज़र रखें; टीम एक JIT-enabled WebAssembly engine जोड़ने की योजना बना रही है, जो Rust में ही लिखा जाएगा।

AI Slop? A pull request removing Zig source files from Bun was automatically flagged.


All benchmark numbers were collected on hardware running Ubuntu 22.04 LTS with kernel 6.5. The test suite version is Bun 1.3.13 (Zig) versus Bun 1.3.14 (Rust).

टिप्पणियाँ

टिप्पणियाँ लोड हो रही हैं...