hn.today

Rust is the answer to the wrong question

intertwingly.net3 points0 comments
Screenshot of Rust is the answer to the wrong question

An engineer describes evolving a Rails CRUD app for dance competition scheduling into a system that must also run offline in judges' browsers and phones. That offline requirement pushed the author to transpile ERB views and minimal business logic into client-side code, which forced serious type inference - tracing instance variables back to controllers and models to distinguish arrays from hashes. That work led to Roundhouse and Spinel: a transpilation toolchain that can emit CRuby, Spinel, Rust, and even Kotlin/Swift, letting a three‑tier Rails app run in the browser with sourcemaps, breakpoints, and watch-mode tests. Demos and downloads show Rails features preserved (TailwindCSS, TurboStreams, Action Cable), and deployments can target Vercel+Neon or Cloudflare Durable Objects without rewriting. Making outputs monomorphic improved performance; emitting Rust as a target sped both Spinel and CRuby.

The core argument is that switching languages - Rust included - is a red herring when the real problem is long‑term maintenance and unexpected requirements. One‑shot rewrites optimize initial authoring but fail to solve security and evolving needs. The practical solution offered is a rock‑solid contract layer or DSL with explicit escape hatches and a compiler that captures intent rather than mechanism, enabling safe, optimizable multi‑target outputs without repeated full rewrites.

Read on intertwingly.net0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Zig v0.17.0

Zig v0.17.0

Zig 0.17.0 introduces a reworked build system, including a new Build Server Protocol and enhanced ELF Linker for better incremental compilation on x86_64-linux. The release also features numerous language, standard library, and package management improvements contributed by over 200 developers. (ziglang.org)

Hardly Promethean

Hardly Promethean

Decreasing costs of native app development and performance optimization shift the software bottleneck from coding to deployment and maintenance. Experts argue that while technology enables faster coding, managing and shipping updates remains a significant challenge. (jardo.dev)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.