Rust


  1. rust 直接调用X11
  2. Rust 需要gcc链接 glibc 或 musl 来进行内存分配、线程管理、文件 I/O 等
  3. rust 为什么需要gcc
  4. Blinc的技术架构与渲染流程
  5. rust package crates modules的使用

https://forge.rust-lang.org/infra/other-installation-methods.html

 ./install.sh --prefix=/ssd1/wy/software/rust-1.93
rustc --version
cargo --version
cargo new hello_cargo
cargo build
cargo run
cargo check

命令说明
rustup update更新所有已安装的工具链
rustup update stable更新 stable 版本
rustup default stable设置默认工具链
rustup install nightly安装 nightly 版本
rustup override set nightly为当前目录设置特定工具链
rustup show查看已安装工具链和当前默认版本
rustup component add clippy rustfmt安装常用组件(静态检查、格式化)
rustup target add x86_64-unknown-linux-gnu添加编译目标(交叉编译)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none
rustup install stable    # 安装 stable
rustup install nightly   # 安装 nightly
应用层 UI 框架
        ↓
Skia / Impeller / wgpu(抽象层)
        ↓
Vulkan / Metal / DX12 / OpenGL(图形 API)
        ↓
显卡驱动
        ↓
GPU 硬件
               ┌───────────────┐
               │    UI 框架     │
               └───────┬───────┘
                       │
       ┌───────────────┼───────────────┐
       │                               │
  Skia (2D引擎)                    wgpu
       │                               │
       └───────────────┬───────────────┘
                       │
                    Vulkan
                       │
                     驱动
                       │
                      GPU

原生控件绑定(Native Widgets)

这些框架通过绑定系统原生控件,实现 UI 样式原生:

框架特点平台适合场景
Relm / Relm4GTK3/GTK4 绑定,Reactive 风格Linux / Windows / macOSLinux 桌面应用,GTK 生态
AzulImmediate Mode + WebRender(GPU渲染)Windows / Linux / macOS现代桌面应用,可 GPU 加速

自绘 / GPU 渲染

这些框架自己管理渲染管线,适合高性能和自定义 UI:

框架渲染方式特点适合场景
DruidRust 原生,跨平台 GUI 框架,使用 Piet 做绘图Windows / Linux / macOS桌面工具,原生风格 UI
eguiwgpu / glow / OpenGLImmediate Mode,Rust 原生,轻量级工具类 UI、游戏调试界面
icedwgpu / GPUFlutter 风格声明式 UI跨平台桌面应用,简单动画
Blincwgpu + 自研 GPU 渲染管线高性能 UI,可做动画/可视化工具高性能可视化、游戏 UI、WebAssembly