< 返回版块

苦瓜小仔 发表于 2025-06-08 00:50

公告:bevy 采用新的网站 bevy.org

bevy.org 是现在的 bevy 官网,原 bevyengine.org 重定向至 bevy.org。

Reddit:https://www.reddit.com/r/rust/comments/1l522ag/bevyengineorg_is_now_bevyorg/

文章《Pyrefly vs. ty: Comparing Python’s Two New Rust-Based Type Checkers》

作者:Edward Li

这篇文章比较了 Python 的两个新的基于 Rust 的类型检查器:pyrefly 和 ty。

两者都处于早期 alpha 阶段,尚未正式发布,但已在 PyCon 2025 的 Typing Summit 上首次官方展示。

pyrefly 是 Meta 的新项目,目标是比之前的 Pyre 更快、更便携和更强大,且更积极地与开源社区互动。

ty 则由 Astral 团队开发,强调渐进式类型保证,即在良好类型化的程序中,移除类型注解不应导致类型错误。

在性能测试中,ty 在多个项目上表现优于 pyrefly,两者都显著快于 mypy 和 pyright。

文章还探讨了两者在目标、增量更新机制和功能支持上的差异,例如 pyrefly 的隐式类型推断和 ty 的交集与否定类型支持。

pyrefly 仓库:https://github.com/facebook/pyrefly

ty 仓库:https://github.com/astral-sh/ty

阅读:https://blog.edward-li.com/tech/comparing-pyrefly-vs-ty/

Reddit:https://www.reddit.com/r/rust/comments/1l4t6nv/pyrefly_vs_ty_comparing_pythons_two_new_rustbased/

RFC#3830: Dedented String Literals

let sql = d"
    create table student(
        id int primary key,
        name text
    )
    ";

// 等价于
let sql = "\
create table student(
    id int primary key,
    name text
)";

RFC:https://github.com/rust-lang/rfcs/pull/3830

Reddit:https://www.reddit.com/r/rust/comments/1l4v5e7/rfc_dedented_string_literals/

讨论:你花了多长时间才适应 Rust?

Reddit:https://www.reddit.com/r/rust/comments/1l4udwz/how_long_did_it_take_you_to_feel_comfortable_with/

--

From 日报小组 苦瓜小仔

社区学习交流平台订阅:

评论区

写评论

还没有评论

1 共 0 条评论, 1 页