sdr-podcast:Proxying is just dumb routing
sdr-podcast 上周开始更新第二季了。
这一期讨论路由、反向代理以及将数据包发送到互联网,以及 James 分享他的 https://poststation.rs/ 如何利用代理,在嵌入式设备和 PC 之间通信。
收听:https://sdr-podcast.com/episodes/proxying-is-just-dumb-routing/
关于 sdr-podcast (Self-Directed Research Podcast):
Amos 和 James 每周会有一个主题对话(围绕 Rust、嵌入式和 Web 服务器),聊最近他们研究的东西,每期附带全文转录。
Amos: Rust 社区著名的长篇技术博客和长视频制作者
James: 独立研究员和全职顾问;Rust 嵌入式团队成员
文章《Zero-Cost 'Tagless Final' in Rust with GADT-style Enums》
作者:inferara
这篇文章探讨了如何在 Rust 中实现零成本的“最终无标签”(Tagless Final)模式,通过使用 GADT 风格的枚举来构建嵌入式领域特定语言(DSL)。
作者通过精心设计的类型系统,利用 Rust 的 never
类型(!
),确保在编译时只有一个枚举变体是可构造的,从而去除了运行时的标签。
这种技术使得复杂的表达式树在编译时被优化为直接的计算指令,完全消除了运行时的解释开销,实现了高性能的零成本抽象。
阅读:https://www.inferara.com/en/blog/rust-tagless-final-gadt/
Reddit:https://www.reddit.com/r/rust/comments/1l228r6/zerocost_tagless_final_in_rust_with_gadtstyle/
文章《How we wrap external C and C++ libraries in Rust》
作者:Jasper Bekkers
这篇文章讨论了如何在 Rust 项目中编写简洁、依赖少且易于维护的 build.rs
文件,以简化与外部 C 和 C++ 库的集成。
文章强调了保持 build.rs
简单的重要性,包括减少依赖、确保构建的可预测性、便于新开发者上手以及提高构建的可重复性。
作者建议仅使用 cc
和 bindgen
两个工具,避免使用 pkg-config
、CMake 和 autotools 等外部构建系统。
文章还介绍了如何通过特征标志(feature flags)来控制是否使用系统库或重新生成绑定文件,并建议将生成的绑定文件提交到版本控制系统中,以减少用户的额外依赖。
通过这些方法,可以实现一个几乎只需运行 cargo build
或 cargo run
的简单 Rust 项目。
阅读:https://www.evolvebenchmark.com/blog-posts/how-we-wrap-external-c-and-cpp-libraries-in-rust
Reddit:https://www.reddit.com/r/rust/comments/1l2n4ga/how_we_wrap_external_c_and_c_libraries_in_rust/
SnapViewer – PyTorch 内存快照查看器
SnapViewer 是 PyTorch 内置内存可视化工具的替代方案。它旨在流畅地处理大量内存快照,从而提供一种高效的方式来分析 PyTorch 模型中的内存使用情况。
- 更快: 流畅显示大内存快照,而不会出现官方快照查看器 https://docs.pytorch.org/memory_viz 中发现的性能问题。
- UI: 使用 WASD 键和鼠标滚动浏览内存时间线。左键点击任意分配即可查看其大小、调用堆栈等信息;右键点击。
- 预处理: 使用提供的 parse_dump.py 脚本将 PyTorch 内存快照转换为压缩的 json 格式。
仓库:https://github.com/Da1sypetals/SnapViewer
Reddit:https://www.reddit.com/r/rust/comments/1l2elwe/snapviewer_an_alternative_pytorch_memory_snapshot/
Oceanstor-fs-client - OceanStor 文件系统 API 客户端
用于管理华为 OceanStor V500R007C70 Kunpeng 上的文件系统的小型 Rust 客户端。
仓库:https://github.com/0xb-s/oceanstor-fs-client
Reddit:https://www.reddit.com/r/rust/comments/1l2mkmq/huawei_oceanstor_v500r007c70_file_system_rust/
近期一些 RFCs
- de-RFC#3829: Remove unsized_locals
- RFC#3826: Procedural macros in same package as app
- RFC#3821: Allow generic impls using local trait bounds
- RFC#3820: Changes to target_feature attribute
- RFC#3817: Promote aarch64-pc-windows-msvc to Tier 1
--
From 日报小组 苦瓜小仔
社区学习交流平台订阅:
评论区
写评论还没有评论