< 返回版块

Lambert 发表于 2023-08-27 00:00

Tags:rust,日报

Stable-Diffusion-XL-Burn:SDXL in Rust

在reddit上看到这个项目 Stable-Diffusion-XL-Burn ,它 是一个基于 Rust 的项目,将stable diffusion xl 移植到了 Rust 深度学习框架 burn 中。在reddit回帖上,已经有小伙伴在热情的尝试,还有小伙伴问到,“what's the performance difference to Pytorch on GPU/CPU?” 社区有小伙伴对这个项目感兴趣吗?👀

Github repo: https://github.com/Gadersd/stable-diffusion-xl-burn 阅读原文:https://www.reddit.com/r/rust/comments/1613ajv/stable_diffusion_xl_in_rust/

Rust 1.72.0 stable发布

Rust Release Team在 Rust Blog上官宣了1.72.0版本的发布,可以使用如下命令,获取1.72.0:

rustup update stable

阅读原文了解更多:https://blog.rust-lang.org/2023/08/24/Rust-1.72.0.html

Rust嵌入式领域应用:Rust on ESP32

这是一篇叙述如何使用 ESP32 和 esp-idf-hal 驱动 LED 点阵的文章,准确说是“ESP32 Standard Library Embedded Rust”,有关SPI 与 MAX7219 LED 点阵。

阅读原文:ESP32 Standard Library Embedded Rust: SPI with the MAX7219 LED Dot Matrix, https://apollolabsblog.hashnode.dev/esp32-standard-library-embedded-rust-spi-with-the-max7219-led-dot-matrix?ref=twitter-share

Rust vs Zig:在性能、安全以及更多方面的对比

根据介绍,原文作者是一名后端&区块链开发工程师,全文可以分为三大板块,一块是讲Rust,一块是讲Zig,还有一块是讲二者的对比。当然,作者也在文末表达了自己的看法,没有什么“Winner”,每个语言都有自己的优势与劣势,在使用一门语言钱=前应该去了解、去研究它。

小编的看法是,不知道为什么,最近Zig突然“小火🔥了一把”,网上有关Zig和Rust之间对比的文章也多了起来。相比Rust,Zig还是一个太初期的语言,还需要时间发展。相比Rust,如果更加关注与现有C代码进行集成,同时还要在性能与内存安全之间找到平衡,说不定可以考虑下Zig。但是更多的,还是要考虑实际的项目需求,个人喜好和未来发展方向么,然后做出选择。这里不引战嗷!

下面有一个表格给我们展示了二者的不同之处,

Feature Rust Zig
Memory safety Rust uses its strict ownership and borrowing rules to ensure that any code a developer writes is safe. Zig uses mechanisms that track and control memory allocation and deallocation to prevent any code that a developer writes from being unsafe.
Syntax Rust emphasizes ownership and lifetimes through explicit annotations, which can lead to longer code. Zig follows a C-like syntax.
Ecosystem Rust offers a robust ecosystem, including libraries, tools, and community support Zig is a younger language with a more miniature ecosystem.
Interoperability Rust has decent FFI compatibility. It works well calling Rust functions from C but it can be challenging to call C functions from Rust. Zig has a superior FFI. It works well calling C functions from Zig and calling Zig functions from C.
Error Handling Rust uses Result and Option types for explicit error handling Zig uses error types, error unions, and deferred statements for error handling
Package manager Rut uses cargo package manager for handling packages and dependencies Zig uses its built-in package manager for handling packages and dependencies

二者的相同之处是:

  • Memory safety
  • Low-level control
  • Performance optimization
  • Community and availability
  • No undefined behavior

具体可以直达原文进行阅读。

阅读原文:https://blog.logrocket.com/comparing-rust-vs-zig-performance-safety-more/

梗图:I spend my day coding in rust today

Twitter mypicbed我不信你真的会裂

X Posts or Tweets:https://twitter.com/tony_mushah/status/1695074658175889881?s=20


From 日报小组 Lambert

社区学习交流平台订阅:

评论区

写评论

还没有评论

1 共 0 条评论, 1 页