跳到正文
Hacker News 熱門(buzzing.cc 中文翻譯)·· 15 天前AI 評分57

Rune 是支援 macOS、Windows、Linux 和 Web 的原生 GPU 渲染 Rust UI 框架

Rune:一款专为 macOS、Windows、Linux 和 Web 设计的、基于原生 GPU 渲染的 Rust UI 框架

AI 導讀

Rune 是支援 macOS、Windows、Linux 和 Web 的原生 GPU 渲染 Rust UI 框架。所有應用程式均可無介面執行,供編碼智能體渲染 PNG、輸出元素樹,並透過腳本輸入操作;框架亦自帶渲染器、文字、版面配置及彈簧效果。

正文

A native GPU-rendered Rust UI framework for macOS, Windows, Linux and the web, with its own renderer, text, layout and springs.

Every app can run headless, so an agent can render to PNG, dump the element tree and drive it with scripted input.

Rune in motion: real apps, rune-kit components and GPU effects

A coding agent app built with Rune

Lit chat interface Split diff component

Liquid metal effect Settings window

fn view(s: &State, _: &mut Cx<State>) -> El {
    let t = tok::theme(true);
    let label = text(if s.on { "Lights on" } else { "Lights off" })
        .font(type_::TITLE).color(t.text);
    let knob = el().key("knob").size(18.0, 18.0).radius(9.0).fill(t.knob)
        .absolute(if s.on { 18.0 } else { 2.0 }, 2.0);
    let switch = el().key("switch").role("switch").label("Lights").checked(s.on)
        .focusable(true).size(38.0, 22.0).radius(11.0)
        .fill(if s.on { tok::accent(0, true) } else { t.control_off })
        .motion(motion::SNAPPY)
        .on_press(|s: &mut State| s.on = !s.on)
        .child(knob);
    col().w_full().h_full().center().gap(16.0).fill(t.bg).child(label).child(switch)
}

Use it with your agent

Give your coding agent this repo. Have it start from examples/hello and crates/rune/README.md, then check its own work headlessly by rendering PNGs and inspecting the element tree.

Build me a with Rune (github.com/anomalyco/rune). Start from examples/hello and check your work headlessly.

Add it

rune = { git = "https://github.com/anomalyco/rune", rev = "<dev rev>" }

Rune is pre-release. Pin a rev of dev; dev is never rewritten.

Docs · Components · Examples · Changelog

Contributing

We don't take pull requests. Have your agent open an issue describing the bug or idea, and our agents usually turn it around fast.

MIT, © Anomaly.

來源:Hacker News 熱門(buzzing.cc 中文翻譯) · github.com