[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.5555/2337223.2337238acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
Article

Combining functional and imperative programming for multicore software: an empirical study evaluating Scala and Java

Published: 02 June 2012 Publication History

Abstract

Recent multi-paradigm programming languages combine functional and imperative programming styles to make software development easier. Given today's proliferation of multicore processors, parallel programmers are supposed to benefit from this combination, as many difficult problems can be expressed more easily in a functional style while others match an imperative style. Due to a lack of empirical evidence from controlled studies, however, important software engineering questions are largely unanswered. Our paper is the first to provide thorough empirical results by using Scala and Java as a vehicle in a controlled comparative study on multicore software development. Scala combines functional and imperative programming while Java focuses on imperative shared-memory programming. We study thirteen programmers who worked on three projects, including an industrial application, in both Scala and Java. In addition to the resulting 39 Scala programs and 39 Java programs, we obtain data from an industry software engineer who worked on the same project in Scala. We analyze key issues such as effort, code, language usage, performance, and programmer satisfaction. Contrary to popular belief, the functional style does not lead to bad performance. Average Scala run-times are comparable to Java, lowest run-times are sometimes better, but Java scales better on parallel hardware. We confirm with statistical significance Scala's claim that Scala code is more compact than Java code, but clearly refute other claims of Scala on lower programming effort and lower debugging effort. Our study also provides explanations for these observations and shows directions on how to improve multi-paradigm languages in the future.

References

[1]
M. Odersky, L. Spoon, and B. Venners, Programming in Scala, 1st ed. Artima, 2007.
[2]
C# Language Specification v. 3.0. Microsoft Corporation, 2007.
[3]
K. Davis and J. Striegnitz, "Multiparadigm Programming in Object-Oriented Languages: Current Research," in Proc. ECOOP 2007 LNCS 4906. Springer, 2008.
[4]
S. H. Fuller and L. I. Millett, "Computing Performance: Game Over or Next Level?" IEEE Computer, vol. 44, no. 1, 2011.
[5]
D. B. Skillicorn and D. Talia, "Models and Languages for Parallel Computation," ACM Comput. Surv., vol. 30, pp. 123-169, June 1998.
[6]
L. Prechelt, "An Empirical Comparison of Seven Programming Languages," Computer, vol. 33, no. 10, pp. 23-29, oct 2000.
[7]
D. Scott, R. Sharp, T. Gazagnaire, and A. Madhavapeddy, "Using Functional Programming within an Industrial. Product Group: Perspectives and Perceptions," in Proc. ACM ICFP, 2010, pp. 87-92.
[8]
R. Harrison, L. Smaraweera, M. Dobie, and P. Lewis, "Comparing Programming Paradigms: An Evaluation of Functional and Object-Oriented Programs," Softw. Eng. Journal, vol. 11, no. 4, pp. 247-254, jul 1996.
[9]
L. Hundt, "Loop Recognition in C++/Java/Go/Scala," Proc. Scala Days, 2011.
[10]
V. Pankratius and A.-R. Adl-Tabatabai, "A Study of Transactional Memory vs. Locks in Practice," in Proc. ACM SPAA, 2011, pp. 43-52.
[11]
V. Pankratius, A. Jannesari, and W. F. Tichy, "Parallelizing BZip2. A Case Study in Multicore Software Engineering," IEEE Softw., vol. 26, pp. 70-77, November 2009.
[12]
V. Pankratius, C. Schaefer, A. Jannesari, and W. F. Tichy, "Software Engineering for Multicore Systems - An Experience Report," in Proc. ACM IWMSE, 2008, pp. 53-60.
[13]
L. Hochstein, J. Carver, F. Shull, S. Asgari, and V. Basili, "Parallel Programmer Productivity: A Case Study of Novice Parallel Programmers," in Proc. ACM SC, 2005.
[14]
V. Basili, J. Carver, D. Cruzes, L. Hochstein, J. Hollingsworth, F. Shull, and M. Zelkowitz, "Understanding the High-Performance-Computing Community: A Software Engineer's Perspective," Software, IEEE, vol. 25, no. 4, pp. 29-36, july-aug. 2008.
[15]
L. B. Christensen, Experimental Methodology, 10th ed. Allyn & Bacon, 2006.
[16]
P. Runeson and M. Höst, "Guidelines for Conducting and Reporting Case Study Research in Software Engineering," Emp. Softw. Eng., vol. 14, no. 2, pp. 131-164, 2009.
[17]
R. K. Yin, Case Study Research: Design and Methods, 3rd ed. Sage Publications, Inc, 2002.
[18]
M. Odersky et al., "An Overview of the Scala Programming Language (second edition)," EPFL, Tech. Rep. LAMP-REPORT-2006-001, 2006.
[19]
M. Schinz and P. Haller, "A Scala Tutorial for Java programmers," www.scala-lang.org, November 9 2010.
[20]
M. Herlihy and N. Shavit, The Art of Multiprocessor Programming. Morgan Kaufmann, 2008.
[21]
T. G. Mattson, B. A. Sanders, and B. L. Massingill, Patterns for Parallel Programming. Addison-Wesley, 2004.
[22]
M. Eriksen, "Scaling Scala at Twitter," in Proc. ACM CUFP, 2010, pp. 8:1-8:1.
[23]
C. A. R. Hoare, Communicating Sequential Processes. Prentice Hall, 2004.
[24]
B. Wilkinson and M. Allen, Parallel Programming. Prentice Hall, 2004.
[25]
N. Juristo and A. M. Moreno, Basics of Software Engineering Experimentation. Kluwer, 2001.
[26]
F. Shull, J. Singer, and D. I. Sjoberg, Eds., Guide to Advanced Empirical Software Engineering. Springer, 2008.
[27]
"Electric," http://www.staticfreesoft.com/index.html, 2011.
[28]
G. E. Bier and A. R. Pleszkun, "An Algorithm for Design Rule Checking on a Multiprocessor," in Proc. AC DAC, 1985.
[29]
M. Hollander and D. A. Wolfe, Nonparametric Statistical Methods. Wiley, 2nd 1999.
[30]
"IBM SPSS Statistics Version 19," http://www.ibm.com/software/analytics/spss/, 2010.
[31]
J. Bloch, Effective Java - Programming Language Guide. Addison Wesley, 2001, pp. 50-56.
[32]
D. Bacon et al., "The "Double-Checked Locking is Broken" Declaration," http://www.cs.umd.edu/~pugh/java/ memoryModel/DoubleCheckedLocking.html, Sep 2011.
[33]
S. Hanenberg, "An Experiment About Static and Dynamic Type Systems. Doubts About the Positive Impact of Static Type Systems on Development Time," in Proc. ACM OOPSLA, 2010.
[34]
A. Meneely, P. Rotella, and L. Williams, "Does Adding Manpower Also Affect Quality? An Empirical, Longitudinal Analysis," in Proc. ACM SIGSOFT/FSE, 2011.

Cited By

View all
  • (2019)Programmers do not favor lambda expressions for concurrent object-oriented codeEmpirical Software Engineering10.1007/s10664-018-9622-924:1(103-138)Online publication date: 1-Feb-2019
  • (2018)Interdisciplinary programming language designProceedings of the 2018 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3276954.3276965(133-146)Online publication date: 24-Oct-2018
  • (2018)What are your programming language's energy-delay implications?Proceedings of the 15th International Conference on Mining Software Repositories10.1145/3196398.3196414(303-313)Online publication date: 28-May-2018
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '12: Proceedings of the 34th International Conference on Software Engineering
June 2012
1657 pages
ISBN:9781467310673

Sponsors

Publisher

IEEE Press

Publication History

Published: 02 June 2012

Check for updates

Qualifiers

  • Article

Conference

ICSE '12
Sponsor:

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)10
  • Downloads (Last 6 weeks)2
Reflects downloads up to 15 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2019)Programmers do not favor lambda expressions for concurrent object-oriented codeEmpirical Software Engineering10.1007/s10664-018-9622-924:1(103-138)Online publication date: 1-Feb-2019
  • (2018)Interdisciplinary programming language designProceedings of the 2018 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3276954.3276965(133-146)Online publication date: 24-Oct-2018
  • (2018)What are your programming language's energy-delay implications?Proceedings of the 15th International Conference on Mining Software Repositories10.1145/3196398.3196414(303-313)Online publication date: 28-May-2018
  • (2017)Understanding and overcoming parallelism bottlenecks in ForkJoin applicationsProceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering10.5555/3155562.3155657(765-775)Online publication date: 30-Oct-2017
  • (2016)How to Architect a Query CompilerProceedings of the 2016 International Conference on Management of Data10.1145/2882903.2915244(1907-1922)Online publication date: 26-Jun-2016
  • (2015)Towards classification of concurrency bugs based on observable propertiesProceedings of the First International Workshop on Complex faUlts and Failures in LargE Software Systems10.5555/2819419.2819428(41-47)Online publication date: 16-May-2015
  • (2015)A comparative study of programming languages in Rosetta codeProceedings of the 37th International Conference on Software Engineering - Volume 110.5555/2818754.2818848(778-788)Online publication date: 16-May-2015
  • (2015)A study on the most popular questions about concurrent programmingProceedings of the 6th Workshop on Evaluation and Usability of Programming Languages and Tools10.1145/2846680.2846687(39-46)Online publication date: 26-Oct-2015
  • (2015)OhuaProceedings of the Principles and Practices of Programming on The Java Platform10.1145/2807426.2807431(51-64)Online publication date: 8-Sep-2015
  • (2014)A large scale study of programming languages and code quality in githubProceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering10.1145/2635868.2635922(155-165)Online publication date: 11-Nov-2014
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media