Sometimes debates on programming languages are more religious than scientific. Questions about which language is more succinct or efficient, or makes developers more productive are discussed with fervor, and their answers are too often based on anecdotes and unsubstantiated beliefs. In this study, we use the largely untapped research potential of Rosetta Code, a code repository of solutions to common programming tasks in various languages, to draw a fair and well-founded comparison. Rosetta Code offers a large data set for analysis. Our study is based on 7087 solution programs corresponding to 745 tasks in 8 widely used languages representing the major programming paradigms (procedural: C and Go; object-oriented: C# and Java; functional: F# and Haskell; scripting: Python and Ruby). Our statistical analysis reveals, most notably, that: functional and scripting languages are more concise than procedural and object-oriented languages; C is hard to beat when it comes to raw speed on large inputs, but performance differences over inputs of moderate size are less pronounced and allow even interpreted languages to be competitive; compiled strongly-typed languages, where more defects can be caught at compile time, are less prone to runtime failures than interpreted or weakly-typed languages. We discuss implications of these results for developers, language designers, and educators.
Comparative analysis of large data processing in Apache Spark using Java, Python and Scala
Ternopil Ivan Puluj National Technical University(特诺皮尔伊万普鲁日国立技术大学);Rochester Institute of Technology(罗切斯特理工学院);Institute of Telecommunications and Global Information Space of the National Academy of Sciences of Ukraine(乌克兰国家科学院电信与全球信息空间研究所)
Performance vs Programming Effort between Rust and C on Multicore Architectures: Case Study in N-Body
历史上,Fortran和C一直是高性能计算(HPC)中的默认程序设计语言。在这两种情况下,程序员都可以使用原语和函数来操纵系统内存并直接与底层硬件交互,从而在响应时间和资源使用方面实现高效的代码。另一方面,在这些类型的语言中生成可维护和可扩展的代码是一个真正的挑战。2010年,Rust作为一种为并发和安全应用程序设计的新程序设计语言出现,它采用了过程式,面向对象和函数式语言的特性。在其设计原则中,Rust的目标是在效率方面与C相匹配,但同时提高代码安全性和生产力。本文介绍了C和Rust在性能和编程工作方面的比较研究,选择作为案例研究的N个计算体(N-Body),在HPC社区的一个流行的问题的模拟。基于实验工作,可以确定Rust是一种减少编程工作量的语言,同时保持可接受的性能水平,这意味着它是C for HPC的可能替代品。