关于不安全Rust对互操作性、封装和工具链影响的混合方法研究
A Mixed-Methods Study on the Implications of Unsafe Rust for Interoperation, Encapsulation, and Tooling
AI总结:
本研究通过混合方法分析了Rust中不安全特性对互操作性、封装及工具链的影响,发现开发者在面临无替代方案时使用不安全代码,但受限的工具支持导致设计不确定性,需开发验证工具以提供安全性保证。
摘要:
Rust编程语言通过限制别名性来提供静态安全保证。然而,在某些情况下,开发者需要通过使用一组不安全特性来绕过这些保证。如果这些特性使用不当,可能会重新引入Rust设计以防止的安全问题。我们试图了解当前开发工具如何改进以更好地帮助那些必须与不安全代码交互的开发者。为此,我们研究了开发者如何思考外部函数调用,他们目前使用的工具的局限性,他们使用不安全代码的动机,以及他们如何思考封装它。我们进行了混合方法研究,包括对19名开发者的半结构化访谈,随后是对另外160名开发者的调查。我们的参与者在感知到没有其他选择时使用不安全代码,但大多数避免使用它。然而,有限的对外部函数调用的支持使参与者对他们的设计选择感到不确定,某些外部别名性和并发模式难以封装。为了克服这些挑战,Rust开发者需要能够提供多语言应用中安全性保证的验证工具。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。