< 返回版块

苦瓜小仔 发表于 2025-06-16 08:19

Tags:日报

文章《Implementing Temporal, the new date/time API for JavaScript (and Rust!)》

作者:Boa Developers

文章介绍了在 Rust 中实现 JavaScript 新日期/时间 API Temporal 的过程。

Temporal 是一个现代的日期/时间处理 API,包含 9 个对象和 200 多种方法。

Boa 团队将其从 JavaScript 引擎中分离出来,开发了 temporal_rs,一个独立的 Rust 日期/时间库,支持 JavaScript 引擎实现 Temporal,并可用于通用日期/时间场景。

文章还探讨了 Temporal 的 JavaScript API 和 Rust API 的实现细节,包括构造函数、Now 类型的实现、部分 API 的设计以及时间区的处理。

temporal_rs 目前已实现大部分 Temporal API,但仍处于开发阶段,部分功能(如时间区)将在后续文章中详细讨论。

temporal_rs 仓库:https://github.com/boa-dev/temporal

阅读:https://boajs.dev/blog/2025/06/15/temporal-impl-1

Reddit:https://www.reddit.com/r/rust/comments/1lcbu61/implementing_temporal_in_rust_the_new_datetime/

公告:发布 Oxlint 1.0 - JavaScript & TypeScript Linter

作者:Boshen Chen & Cameron Clark

Oxlint 1.0 正式发布,这是一个基于 Rust 的 JavaScript 和 TypeScript 代码检查工具。

它比 ESLint 快 50~100 倍,支持超过 500 条 ESLint 规则,已被 Shopify、Airbnb 和 Mercedes-Benz 等大公司采用。

Oxlint 提供零配置快速启动,支持 .oxlintrc.json 配置文件,兼容 ESLint v8 的扁平化配置格式,便于迁移。

它还支持 VS Code 等编辑器扩展,并提供清晰的错误提示。未来计划支持自定义规则和进一步优化性能。

Oxlint 仓库:https://github.com/oxc-project/oxc

阅读:https://voidzero.dev/posts/announcing-oxlint-1-stable

Reddit:https://www.reddit.com/r/rust/comments/1lbv33t/voidzero_announces_oxlint_10_the_first_stable/

文章《Windows API hooking with Rust on Windows ARM》

作者:Lynx

文章介绍了在 Windows ARM 系统上使用 Rust 实现 Windows API 钩子(hooking)的技术。

作者探讨了两种 API 钩子方法:简单钩子和跳板(trampoline)钩子。

简单钩子通过直接覆盖函数入口指令实现,但存在性能瓶颈和线程安全问题。

跳板钩子则通过创建一个跳板函数来执行被覆盖的原始指令,并跳回原函数的正确位置,避免了简单钩子的缺陷。

文章详细讨论了 ARM64 架构的指令集特性,特别是如何处理 adrpcbz 等指令的相对寻址问题,并提供了完整的跳板生成和使用示例。

作者的研究很大程度上受到了微软 Detours 库的启发,并且在解决问题时借鉴了其中的一些想法。在某些情况下,尤其是在处理与 PC 相关的指令时,ta 探索了更简单的机制,因此这个项目融合了自己的解决方案和受 Detours 影响的想法。

阅读:https://malware-decoded.com/3-api-hooking-with-rust/

仓库:https://github.com/malware-decoded/rust-windows-arm64-api-hooking

Reddit:https://www.reddit.com/r/rust/comments/1lburda/windows_api_hooking_with_rust_on_windows_arm/

Zeekstd - Zstd Seekable Format 的 Rust 实现

Zeekstd 使用纯 Rust 实现 Zstandard 可寻址格式。

该格式将压缩数据分割为独立的“帧”,可单独解压,从而支持从压缩文件中间部分开始解压,而无需解压整个文件。

作者因需要恢复大文件下载而开发此项目,因现有 C 实现存在缺陷,故用 Rust 从头开发,依赖 zstd 高级压缩 API。

该项目包含单依赖库和类似常规 zstd 的 CLI 工具。

仓库:https://github.com/rorosen/zeekstd

Reddit:https://www.reddit.com/r/rust/comments/1lc3aap/zeekstd_rust_implementation_of_the_zstd_seekable/

Laufey - Rust 后端依赖注入框架

作者开发了 Laufey,一个 Rust 中的自动依赖注入框架,目前处于概念验证阶段。

以 Axum 框架为例,作者实现了一个 PostgreSQL 数据库连接池(PgsqlConnectionPool)作为单例模式,并创建了按需获取数据库连接的服务(Pgsql)。

通过 Laufey 的特性,这些组件的依赖关系可以自动解析,无需手动配置,简化了开发流程。

仓库:https://gitlab.com/tomshoo/laufey

Reddit:https://www.reddit.com/r/rust/comments/1lcc1vp/update_regarding_my_di_framework_loki/

Form_fields - HTML 表单输入和验证

form_fields 是一个用于处理表单输入和验证的 Rust crate。

它通过派生宏简化表单处理,支持 Axum 和 Maud。

使用时,开发者定义数据结构,派生宏自动生成验证和表单字段处理代码,减少重复工作。

仓库中有更高级的 示例,用于处理延迟验证、动态选项和数据加载。

仓库:https://github.com/HookedBehemoth/axum-form-fields

Reddit:https://www.reddit.com/r/rust/comments/1lcak5w/form_fields_crate_for_dealing_with_form_inputs/

Rusotp - OTP(一次性密码)生成和验证库

OTP (one-time password,一次性密码) 生成与验证库。

  • 实现了 RFC4226 和 RFC6238
  • 支持生成字母数字型 OTP
  • 支持 HmacSha1、HmacSha256 和 HmacSha512 摘要算法

仓库:https://github.com/eendroroy/rusotp

Reddit:https://www.reddit.com/r/rust/comments/1lbzhww/otp_generation_library_written_in_rust/

--

From 日报小组 苦瓜小仔

社区学习交流平台订阅:

评论区

写评论

还没有评论

1 共 0 条评论, 1 页