当前位置: 首页 > news >正文

Upcoming Rust language features for kernel development - 教程

The Rust for Linux project has been good for Rust, Tyler Mandry, one of the co-leads of Rust's language-design team, said. He gave a talk at Kangrejos 2025 covering upcoming Rust language features and thanking the Rust for Linux developers for helping drive them forward. Afterward, Benno Lossin and Xiangfei Ding went into more detail about their work on the three most important language features for kernel development: field projections, in-place initialization, and arbitrary self types.

Rust 的语言设计团队联合负责人 Tyler Mandry 表示,Rust for Linux 项目对 Rust 本身非常有益。他在 2025 年的 Kangrejos 大会上发表了演讲,介绍了即将推出的 Rust 语言特性,并感谢 Rust for Linux 的开发者们推动这些特性的进展。随后,Benno Lossin 和丁向飞详细介绍了他们在内核编写中最重要的三个语言特性方面的工作:字段投影、就地初始化以及任意 self 类型。

Many people have remarked that the development of new language features in Rust can be quite slow, Mandry said. Partly, that can be attributed to the care the Rust language team takes to avoid enshrining bad designs. But the biggest reason is "alignment in attention". The Rust project is driven by volunteers, which means that if there are not people focusing on pushing a given feature or group of related features forward, they languish. The Rust for Linux project has actually been really helpful for addressing that, Mandry explained, because it is something that a lot of people are excited about, and that focuses effort onto the few specific things that the Linux kernel needs.

Mandry 表示,许多人认为 Rust 新语言特性的开发进展可能相当缓慢。这在一定程度上是因为 Rust 语言团队非常谨慎,避免将糟糕的设计固定下来。但最大原因是“关注的对齐”。Rust 项目由志愿者驱动,这意味着如果没有人专注于推进某个特性或相关特性组,这些特性就会停滞不前。Mandry 解释说,Rust for Linux 项目在这方面十分有帮助,因为这是一个让很多人兴奋的项目,并且把努力集中在 Linux 内核真正需要的少数特性上。

Mandry then went through a whirlwind list of upcoming language features, including types without known size information, reference-counting improvements, user-defined function modifiers of the same kind as const, and more. At the end, he asked which of those were most important to Rust for Linux, and how the assembled kernel developers would prioritize them. Beyond the three features to be discussed later, Lossin said that the project definitely wanted the ability to write functions that can be evaluated at compile time (called const functions in Rust) in trait definitions. Danilo Krummrich asked for specialization, which immediately prompted an "Oh no!" from Lossin, due to the feature's nearly decade-long history of causing problems for Rust's type system. Specialization would allow two overlapping implementations for a single trait to exist, with the compiler picking the more specific one. Matthew Maurer asked for some ability to control what the compiler does on integer overflow.

通过随后,Mandry 敏捷列出了即将推出的语言特性,包括未知大小信息类型、引用计数改进、类似 const 的用户自定义函数修饰符等。最后,他询问这些特性中哪些对 Rust for Linux 最重要,以及在场的内核开发者会如何优先考虑它们。Lossin 表示,除了稍后讨论的三个特性之外,项目确实希望能够在 trait 定义中编写能够在编译时求值的函数(Rust 中称为 const 函数)。Danilo Krummrich 提出了特化(specialization)的需求,这立刻引起了 Lossin 的 “Oh no!” 反应,由于该特性在 Rust 类型环境中几乎有十年的历史问题。特化允许对同一个 trait 存在两个重叠实现,编译器会选择更具体的一个。Matthew Maurer 则希望能够控制编译器在整数溢出时的行为。

Ultimately, Miguel Ojeda told Mandry that the priority should be on stabilizing the unstable language features that Rust for Linux currently uses, followed by language features that would change how the project structures its code, followed by everything else. The next two talks went into much more detail about the current status and future plans for some of those key language features.

最终,Miguel Ojeda 告诉 Mandry,优先级应该是:首先稳定 Rust for Linux 当前使用的不稳定语言特性,其次是那些会改变工程代码结构的语言特性,最后才是其他特性。接下来的两场演讲更详细地介绍了这些关键语言特性的当前状态和未来计划。

Field projections
Field projection refers to the idea of taking a pointer to a structure, and turning it into a pointer to a field of the structure. Rust does already have this for the built-in reference and pointer types, but it can't always be made to work for user-defined smart-pointer types. Since the Rust for Linux developers would like to have custom sm

http://www.jsqmd.com/news/40488/

相关文章:

  • 详细介绍:Linux网络性能测试利器:iperf3使用指南
  • linux 安装telnet 服务
  • 实用指南:【STM32】RTC实时时钟
  • 探索乐泰胶水:性能与适用场景全解析
  • 【System Beats!】第七章 链接
  • oracle 11g r2 linux
  • 实用指南:接口测试 | 使用Postman实际场景化测试
  • 应用程序建立的数据库连接,也就是非交互式连接 是什么时候开始的?什么时候结束?连接结束后 会影响应用程序操作db失败吗? 还有就是如果连接关闭了 会立马重新建立新的连接吗?
  • 2025高压合金管实力厂家推荐榜:5310/6479 高压合金管型号领衔,天津大无缝联合钢铁有限公司五星领跑工业用材赛道
  • Kafka协调器:消费者组管理与重平衡机制 - 指南
  • #题解#洛谷P1884#二维离散化#
  • HarmonyOS应用配置文件与资源组织深度解析 - 教程
  • 2025扫描电镜精选榜:富泰微五星领衔,日立、国仪携超高分辨率/钨灯丝 SEM,适配科研工业多元需求
  • 2025智能科技/医疗设备/信息科技/新中式茶饮/科创/平面/东方美学/品牌设计/品牌logo设计/品牌VI设计领域优质公司排行榜:聚焦全案创意与视觉赋能,3 家机构助力品牌高效破圈
  • 2025修护/二硫化硒去屑/香氛/控油蓬松/洗发水品牌推荐榜:精准护养新选择,MASIL玛丝兰领衔解决头屑、扁塌等护发难题
  • 2025防火/模压/瓦楞/大跨距/热镀锌/热浸锌/不锈钢/光伏/铝合金/锌铝镁电缆桥架优选榜:河北百著全系列防护覆盖 三家实力厂家凭场景优势突围
  • 2025厨房/无烟管/商用/复合式/内循环/小型/油烟净化/一体机推荐榜:上海多环五星领跑 全场景适配解锁餐饮 / 家用净化新体验
  • 2分钟选刊!值得农林环境人收藏的6个期刊!境科研人必备!
  • antd 上传文件组件在表单回显时不显示下载按钮
  • 2025武汉车出租厂家推荐榜:防撞车出租/高空车出租/登高车出租/服务体验与高性价比深度解析
  • 2025滚齿机优质厂家推荐榜:济南兴宇数控五星领跑,三大厂商凭技术与适配性成行业标杆
  • 2025年芝麻白/芝麻灰/火烧面/亚光面/花岗岩/路岩石优质厂家优选榜:聚焦专业品质,助力工程建设
  • 102302141_易敏亮第三次数据采集作业
  • 2025试验机厂家推荐榜:万能试验机/高低温试验机/钢丝绳试验机专精之选
  • 2025广东洗头机厂家推荐榜:盛泰科技领衔,三大品牌解锁高效洗护新体验
  • 2025泰安软件开发公司推荐榜:软件开发公司/软件公司/泰安软件公司技术实力助力企业数字化转型
  • mysql数据设计中的性能分析工具
  • 2025北京日式搬家公司企业推荐:单位搬家公司/北京搬家公司电话/全流程服务与技术实力深度解析
  • 2025年第43周数字取证与事件响应技术动态
  • 深入解析:【Linux基础学习】Linux Ubuntu 权限管理:从入门到精通