skip to main content

Scala implicits are everywhere: a large-scale study of the use of Scala implicits in the wild

Published:10 October 2019Publication History
Skip Abstract Section

Abstract

The Scala programming language offers two distinctive language features implicit parameters and implicit conversions, often referred together as implicits. Announced without fanfare in 2004, implicits have quickly grown to become a widely and pervasively used feature of the language. They provide a way to reduce the boilerplate code in Scala programs. They are also used to implement certain language features without having to modify the compiler. We report on a large-scale study of the use of implicits in the wild. For this, we analyzed 7,280 Scala projects hosted on GitHub, spanning over 8.1M call sites involving implicits and 370.7K implicit declarations across 18.7M lines of Scala code.

Skip Supplemental Material Section

Supplemental Material

a163-krikava

Presentation at OOPSLA '19

References

  1. Eugene Burmako. 2017. Unification of Compile-Time and Runtime Metaprogramming in Scala. (2017).Google ScholarGoogle Scholar
  2. Jorge Vicente Cantero. 2018. Speeding Up Compilation Time with scalac-profiling. https://bit.ly/32gwTwPGoogle ScholarGoogle Scholar
  3. Jonas De Bleser, Dario Di Nucci, and Coen De Roover. 2019. Assessing Diffusion and Perception of Test Smells in Scala Projects. In International Conference on Mining Software Repositories (MSR).Google ScholarGoogle Scholar
  4. Georgios Gousios. 2013. The GHTorrent dataset and tool suite. In Working Conference on Mining Software Repositories (MSR).Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Li Haoyi. 2016. Implicit Design Patterns in Scala. https://web.archive.org/web/20180326160306/http://www.lihaoyi.com/ post/ImplicitDesignPatternsinScala.html .Google ScholarGoogle Scholar
  6. Joeri De Koster. 2015. Domains: Language Abstractions for Controlling Shared Mutable State in Actor Systems. Ph.D. Dissertation. Vrije Universiteit Brussel, Belgium.Google ScholarGoogle Scholar
  7. R Lämmel and K Ostermann. 2006. Software extension and integration with type classes. Conference on Generative Programming and Component Engineering (GPCE).Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Jeffrey R. Lewis, John Launchbury, Erik Meijer, and Mark B. Shields. 2000. Implicit Parameters: Dynamic Scoping with Static Types. In Symposium on Principles of Programming Languages (POPL).Google ScholarGoogle Scholar
  9. Lightbend. 2018. Scala Developer Suvey. https://bit.ly/2Uk56sB .Google ScholarGoogle Scholar
  10. Cristina V. Lopes, Petr Maj, Pedro Martins, Vaibhav Saini, Di Yang, Jakub Zitny, Hitesh Sajnani, and Jan Vitek. 2017. DéjàVu: a map of code duplicates on GitHub. Proc. ACM Program. Lang. 1, OOPSLA.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Chris Marshall. 2009. Is the Scala 2.8 collections library a case of the longest suicide note in history? https://stackoverflow. com/questions/1722726/is-the-scala-2-8-collections-library-a-case-of-the-longest-suicide-note-in-hist .Google ScholarGoogle Scholar
  12. Heather Miller, Philipp Haller, Eugene Burmako, and Martin Odersky. 2013. Instant Pickles: Generating Object-oriented Pickler Combinators for Fast and Extensible Serialization. In Cconference on Object Oriented Pogramming Systems Languages and Applications (OOPSLA).Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Heather Miller, Philipp Haller, and Martin Odersky. 2014. Spores: A Type-Based Foundation for Closures in the Age of Concurrency and Distribution. In European Conference on Object-Oriented Programming (ECOOP).Google ScholarGoogle Scholar
  14. Martin Odersky. 2017. What to leave implicit. https://www.youtube.com/watch?v=Oij5V7LQJsA . In ScalaDays Chicago.Google ScholarGoogle Scholar
  15. Martin Odersky, Olivier Blanvillain, Fengyun Liu, Aggelos Biboudis, Heather Miller, and Sandro Stucki. 2017. Simplicitly: foundations and applications of implicit function types. PACMPL 2, POPL.Google ScholarGoogle Scholar
  16. Martin Odersky and Adriaan Moors. 2009. Fighting bit rot with types (experience report: Scala collections). In Foundations of Software Technology and Theoretical Computer Science (FST TCS).Google ScholarGoogle Scholar
  17. Bruno Oliveira C. d. S., Adriaan Moors, and Martin Odersky. 2010. Type classes as objects and implicits. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA).Google ScholarGoogle Scholar
  18. Bruno Oliveira C. d. S., Tom Schrijvers, Wontae Choi, Wonchan Lee, and Kwangkeun Yi. 2012. The implicit calculus: a new foundation for generic programming. In Conference on Programming Language Design and Implementation (PLDI).Google ScholarGoogle Scholar
  19. Andrew Phillips and Nermin Serifovic. 2014. Scala Puzzlers. Artima Inc.Google ScholarGoogle Scholar
  20. Michael Pradel and Koushik Sen. 2015. The Good, the Bad, and the Ugly: An Empirical Study of Implicit Type Conversions in JavaScript. In European Conference on Object-Oriented Programming (ECOOP).Google ScholarGoogle Scholar
  21. John C. Reynolds. 1991. The coherence of languages with intersection types. Theoretical Aspects of Computer SoftwareGoogle ScholarGoogle Scholar
  22. Arjen Rouvoet. 2016. Programs for Free: Towards the Formalization of Implicit Resolution in Scala. Master’s thesis. TU Delft.Google ScholarGoogle Scholar
  23. Miles Sabin. 2019. Shapeless. https://github.com/milessabin/shapeless .Google ScholarGoogle Scholar
  24. Tom Schrijvers, Bruno C. d. S. Oliveira, Philip Wadler, and Koar Marntirosian. 2019. Cochis: Stable and Coherent Implicits. Journal of Functional ProgrammingGoogle ScholarGoogle ScholarCross RefCross Ref
  25. Joshua D Suereth. 2013. Implicit Classes. https://web.archive.org/web/20170922191333/https://docs.scala-lang.org/overviews/ core/implicit-classes.html .Google ScholarGoogle Scholar
  26. Ole Tange et al. 2011. Gnu parallel-the command-line power tool. The USENIX Magazine 36, 1.Google ScholarGoogle Scholar
  27. Samira Tasharofi, Peter Dinges, and Ralph E. Johnson. 2013. Why Do Scala Developers Mix the Actor Model with other Concurrency Models?. In European Conference on Object-Oriented Programming (ECOOP).Google ScholarGoogle Scholar
  28. Eric Torreborre. 2017. Achieving 3.2x Faster Scala Compile Time. https://jobs.zalando.com/tech/blog/achieving-3.2x-fasterscala-compile-time/Google ScholarGoogle Scholar
  29. Philip Wadler and Stephen Blott. 1989. How to Make ad-hoc Polymorphism Less ad-hoc. In Symposium on Principles of Programming Languages (POPL).Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Scala implicits are everywhere: a large-scale study of the use of Scala implicits in the wild

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!