The Rust programming language restricts aliasing to provide static safety guarantees. However, in certain situations, developers need to bypass these guarantees by using a set of unsafe features. If they are used incorrectly, these features can reintroduce the types of safety issues that Rust was designed to prevent. We seek to understand how current development tools can be improved to better assist developers who find it necessary to interact with unsafe code. To that end, we study how developers reason about foreign function calls, the limitations of the tools that they currently use, their motivations for using unsafe code, and how they reason about encapsulating it. We conducted a mixed-methods investigation consisting of semi-structured interviews with 19 developers, followed by a survey that reached an additional 160 developers. Our participants were motivated to use unsafe code when they perceived that there was no alternative, and most avoided using it. However, limited tooling support for foreign function calls made participants uncertain about their design choices, and certain foreign aliasing and concurrency patterns were difficult to encapsulate. To overcome these challenges, Rust developers need verification tools that can provide guarantees of soundness within multi-language applications.


翻译:Rust 编程语言通过限制别名使用以提供静态安全保证。然而在某些情况下,开发者需要通过一组不安全特性来绕过这些保证。若使用不当,这些特性可能重新引入 Rust 设计初衷所要预防的安全问题。本研究旨在探究如何改进现有开发工具,以更好地协助必须处理不安全代码的开发者。为此,我们研究了开发者如何理解外部函数调用、现有工具的局限性、使用不安全代码的动机,以及他们如何考虑代码封装策略。我们采用混合研究方法:首先对 19 位开发者进行半结构化访谈,随后开展覆盖 160 位开发者的问卷调查。研究发现:参与者仅在认为别无选择时才会使用不安全代码,且多数开发者倾向于避免使用。然而,外部函数调用工具支持的不足使参与者对其设计决策产生疑虑,某些外部别名模式与并发模式也难以实现有效封装。为应对这些挑战,Rust 开发者需要能在多语言应用中提供正确性保证的验证工具。

0
下载
关闭预览

相关内容

人机协作《编队系统中不安全协作控制的系统理论分析》
专知会员服务
23+阅读 · 2024年11月23日
《基于高斯混合流和入包的异常检测》2023最新57页论文
专知会员服务
28+阅读 · 2023年5月15日
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
联邦学习安全与隐私保护研究综述
专知
12+阅读 · 2020年8月7日
区块链隐私保护研究综述——祝烈煌详解
计算机研究与发展
23+阅读 · 2018年11月28日
放弃 RNN/LSTM 吧,因为真的不好用!望周知~
人工智能头条
19+阅读 · 2018年4月24日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2012年12月31日
VIP会员
相关VIP内容
人机协作《编队系统中不安全协作控制的系统理论分析》
专知会员服务
23+阅读 · 2024年11月23日
《基于高斯混合流和入包的异常检测》2023最新57页论文
专知会员服务
28+阅读 · 2023年5月15日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员