• DocumentCode
    2443597
  • Title

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

  • Author

    Pankratius, Victor ; Schmidt, Felix ; Garretón, Gilda

  • Author_Institution
    Karlsruhe Inst. of Technol., Karlsruhe, Germany
  • fYear
    2012
  • fDate
    2-9 June 2012
  • Firstpage
    123
  • Lastpage
    133
  • 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.
  • Keywords
    Java; functional programming; multiprocessing programs; parallel programming; software engineering; Java; Scala; functional programming; imperative programming; imperative shared-memory programming; language usage; multicore software development; multiparadigm programming languages; parallel programmers; programmer satisfaction; Debugging; Java; Multicore processing; Parallel programming; Software; Testing;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Software Engineering (ICSE), 2012 34th International Conference on
  • Conference_Location
    Zurich
  • ISSN
    0270-5257
  • Print_ISBN
    978-1-4673-1066-6
  • Electronic_ISBN
    0270-5257
  • Type

    conf

  • DOI
    10.1109/ICSE.2012.6227200
  • Filename
    6227200