• 文献检索
  • 文档翻译
  • 深度研究
  • 学术资讯
  • Suppr Zotero 插件Zotero 插件
  • 邀请有礼
  • 套餐&价格
  • 历史记录
应用&插件
Suppr Zotero 插件Zotero 插件浏览器插件Mac 客户端Windows 客户端微信小程序
定价
高级版会员购买积分包购买API积分包
服务
文献检索文档翻译深度研究API 文档MCP 服务
关于我们
关于 Suppr公司介绍联系我们用户协议隐私条款
关注我们

Suppr 超能文献

核心技术专利:CN118964589B侵权必究
粤ICP备2023148730 号-1Suppr @ 2026

文献检索

告别复杂PubMed语法,用中文像聊天一样搜索,搜遍4000万医学文献。AI智能推荐,让科研检索更轻松。

立即免费搜索

文件翻译

保留排版,准确专业,支持PDF/Word/PPT等文件格式,支持 12+语言互译。

免费翻译文档

深度研究

AI帮你快速写综述,25分钟生成高质量综述,智能提取关键信息,辅助科研写作。

立即免费体验

对Rust代码冗长性、可理解性和复杂性的评估。

Evaluation of Rust code verbosity, understandability and complexity.

作者信息

Ardito Luca, Barbato Luca, Coppola Riccardo, Valsesia Michele

机构信息

Department of Control and Computer Engineering, Polytechnic Institute of Turin, Torino, Piemonte, Italia.

Luminem, Torino, Piemonte, Italia.

出版信息

PeerJ Comput Sci. 2021 Feb 26;7:e406. doi: 10.7717/peerj-cs.406. eCollection 2021.

DOI:10.7717/peerj-cs.406
PMID:33817049
原文链接:https://pmc.ncbi.nlm.nih.gov/articles/PMC7959618/
Abstract

Rust is an innovative programming language initially implemented by Mozilla, developed to ensure high performance, reliability, and productivity. The final purpose of this study consists of applying a set of common static software metrics to programs written in Rust to assess the verbosity, understandability, organization, complexity, and maintainability of the language. To that extent, nine different implementations of algorithms available in different languages were selected. We computed a set of metrics for Rust, comparing them with the ones obtained from C and a set of object-oriented languages: C++, Python, JavaScript, TypeScript. To parse the software artifacts and compute the metrics, it was leveraged a tool called that was extended with a software module, written in Python, with the aim of uniforming and comparing the results. The Rust code had an average verbosity in terms of the raw size of the code. It exposed the most structured source organization in terms of the number of methods. Rust code had a better Cyclomatic Complexity, Halstead Metrics, and Maintainability Indexes than C and C++ but performed worse than the other considered object-oriented languages. Lastly, the Rust code exhibited the lowest COGNITIVE complexity of all languages. The collected measures prove that the Rust language has average complexity and maintainability compared to a set of popular languages. It is more easily maintainable and less complex than the C and C++ languages, which can be considered syntactically similar. These results, paired with the memory safety and safe concurrency characteristics of the language, can encourage wider adoption of the language of Rust in substitution of the C language in both the open-source and industrial environments.

摘要

Rust是一种最初由Mozilla实现的创新型编程语言,其开发目的是确保高性能、可靠性和生产力。本研究的最终目的是将一组常见的静态软件指标应用于用Rust编写的程序,以评估该语言的冗长性、可理解性、组织性、复杂性和可维护性。为此,选择了不同语言中可用的九种不同算法实现。我们为Rust计算了一组指标,并将它们与从C以及一组面向对象语言(C++、Python、JavaScript、TypeScript)获得的指标进行比较。为了解析软件工件并计算指标,我们利用了一个名为 的工具,该工具通过一个用Python编写的软件模块进行了扩展,目的是统一和比较结果。就代码的原始大小而言,Rust代码的冗长性平均。就方法数量而言,它展现出最结构化的源组织。Rust代码的圈复杂度、哈尔斯特德度量和可维护性指数比C和C++更好,但比其他考虑的面向对象语言表现更差。最后,Rust代码在所有语言中展现出最低的认知复杂度。收集到的度量结果证明,与一组流行语言相比,Rust语言具有平均的复杂度和可维护性。它比C和C++语言更易于维护且复杂度更低,C和C++在语法上可被认为是相似的。这些结果,再加上该语言的内存安全性和安全并发特性,可以鼓励在开源和工业环境中更广泛地采用Rust语言来替代C语言。

https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/c86a5fda4635/peerj-cs-07-406-g010.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/b3f3872170db/peerj-cs-07-406-g001.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/94261e501bd9/peerj-cs-07-406-g002.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/f8832a61771f/peerj-cs-07-406-g003.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/4034705ed158/peerj-cs-07-406-g004.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/58e45764f21e/peerj-cs-07-406-g005.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/3a2b91adafeb/peerj-cs-07-406-g006.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/fad10ce7d1ac/peerj-cs-07-406-g007.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/987da2dd40ba/peerj-cs-07-406-g008.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/945964cbd487/peerj-cs-07-406-g009.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/c86a5fda4635/peerj-cs-07-406-g010.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/b3f3872170db/peerj-cs-07-406-g001.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/94261e501bd9/peerj-cs-07-406-g002.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/f8832a61771f/peerj-cs-07-406-g003.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/4034705ed158/peerj-cs-07-406-g004.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/58e45764f21e/peerj-cs-07-406-g005.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/3a2b91adafeb/peerj-cs-07-406-g006.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/fad10ce7d1ac/peerj-cs-07-406-g007.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/987da2dd40ba/peerj-cs-07-406-g008.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/945964cbd487/peerj-cs-07-406-g009.jpg
https://cdn.ncbi.nlm.nih.gov/pmc/blobs/10cc/7959618/c86a5fda4635/peerj-cs-07-406-g010.jpg

相似文献

1
Evaluation of Rust code verbosity, understandability and complexity.对Rust代码冗长性、可理解性和复杂性的评估。
PeerJ Comput Sci. 2021 Feb 26;7:e406. doi: 10.7717/peerj-cs.406. eCollection 2021.
2
Rust-Bio: a fast and safe bioinformatics library.Rust-Bio:一个快速且安全的生物信息学库。
Bioinformatics. 2016 Feb 1;32(3):444-6. doi: 10.1093/bioinformatics/btv573. Epub 2015 Oct 6.
3
A comparison of common programming languages used in bioinformatics.生物信息学中常用编程语言的比较。
BMC Bioinformatics. 2008 Feb 5;9:82. doi: 10.1186/1471-2105-9-82.
4
Ten simple rules on writing clean and reliable open-source scientific software.关于编写干净可靠的开源科学软件的十则简单规则。
PLoS Comput Biol. 2021 Nov 11;17(11):e1009481. doi: 10.1371/journal.pcbi.1009481. eCollection 2021 Nov.
5
PyLandStats: An open-source Pythonic library to compute landscape metrics.PyLandStats:一个开源的 Python 风格库,用于计算景观指标。
PLoS One. 2019 Dec 5;14(12):e0225734. doi: 10.1371/journal.pone.0225734. eCollection 2019.
6
A systematic literature review on the applications of recurrent neural networks in code clone research.基于循环神经网络在代码克隆研究中的应用的系统性文献回顾。
PLoS One. 2024 Feb 2;19(2):e0296858. doi: 10.1371/journal.pone.0296858. eCollection 2024.
7
Haxe as a Swiss knife for bioinformatic applications: the SeqPHASE case story.Haxe 作为生物信息学应用的瑞士军刀:SeqPHASE 案例故事。
Brief Bioinform. 2024 Jul 25;25(5). doi: 10.1093/bib/bbae367.
8
A fast and efficient python library for interfacing with the Biological Magnetic Resonance Data Bank.一个用于与生物磁共振数据库接口的快速高效的Python库。
BMC Bioinformatics. 2017 Mar 17;18(1):175. doi: 10.1186/s12859-017-1580-5.
9
NeuroPycon: An open-source python toolbox for fast multi-modal and reproducible brain connectivity pipelines.NeuroPycon:一个开源的 Python 工具包,用于快速进行多模态和可重复的脑连接管道。
Neuroimage. 2020 Oct 1;219:117020. doi: 10.1016/j.neuroimage.2020.117020. Epub 2020 Jun 6.
10
On the accuracy of code complexity metrics: A neuroscience-based guideline for improvement.关于代码复杂度度量的准确性:基于神经科学的改进指南。
Front Neurosci. 2023 Feb 7;16:1065366. doi: 10.3389/fnins.2022.1065366. eCollection 2022.

本文引用的文献

1
Rust-Bio: a fast and safe bioinformatics library.Rust-Bio:一个快速且安全的生物信息学库。
Bioinformatics. 2016 Feb 1;32(3):444-6. doi: 10.1093/bioinformatics/btv573. Epub 2015 Oct 6.