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.
Supplemental Material
- Eugene Burmako. 2017. Unification of Compile-Time and Runtime Metaprogramming in Scala. (2017).Google Scholar
- Jorge Vicente Cantero. 2018. Speeding Up Compilation Time with scalac-profiling. https://bit.ly/32gwTwPGoogle Scholar
- 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 Scholar
- Georgios Gousios. 2013. The GHTorrent dataset and tool suite. In Working Conference on Mining Software Repositories (MSR).Google Scholar
Digital Library
- Li Haoyi. 2016. Implicit Design Patterns in Scala. https://web.archive.org/web/20180326160306/http://www.lihaoyi.com/ post/ImplicitDesignPatternsinScala.html .Google Scholar
- Joeri De Koster. 2015. Domains: Language Abstractions for Controlling Shared Mutable State in Actor Systems. Ph.D. Dissertation. Vrije Universiteit Brussel, Belgium.Google Scholar
- R Lämmel and K Ostermann. 2006. Software extension and integration with type classes. Conference on Generative Programming and Component Engineering (GPCE).Google Scholar
Digital Library
- 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 Scholar
- Lightbend. 2018. Scala Developer Suvey. https://bit.ly/2Uk56sB .Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- Martin Odersky. 2017. What to leave implicit. https://www.youtube.com/watch?v=Oij5V7LQJsA . In ScalaDays Chicago.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- Andrew Phillips and Nermin Serifovic. 2014. Scala Puzzlers. Artima Inc.Google Scholar
- 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 Scholar
- John C. Reynolds. 1991. The coherence of languages with intersection types. Theoretical Aspects of Computer SoftwareGoogle Scholar
- Arjen Rouvoet. 2016. Programs for Free: Towards the Formalization of Implicit Resolution in Scala. Master’s thesis. TU Delft.Google Scholar
- Miles Sabin. 2019. Shapeless. https://github.com/milessabin/shapeless .Google Scholar
- Tom Schrijvers, Bruno C. d. S. Oliveira, Philip Wadler, and Koar Marntirosian. 2019. Cochis: Stable and Coherent Implicits. Journal of Functional ProgrammingGoogle Scholar
Cross Ref
- Joshua D Suereth. 2013. Implicit Classes. https://web.archive.org/web/20170922191333/https://docs.scala-lang.org/overviews/ core/implicit-classes.html .Google Scholar
- Ole Tange et al. 2011. Gnu parallel-the command-line power tool. The USENIX Magazine 36, 1.Google Scholar
- 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 Scholar
- Eric Torreborre. 2017. Achieving 3.2x Faster Scala Compile Time. https://jobs.zalando.com/tech/blog/achieving-3.2x-fasterscala-compile-time/Google Scholar
- Philip Wadler and Stephen Blott. 1989. How to Make ad-hoc Polymorphism Less ad-hoc. In Symposium on Principles of Programming Languages (POPL).Google Scholar
Digital Library
Index Terms
Scala implicits are everywhere: a large-scale study of the use of Scala implicits in the wild
Recommendations
Simplicitly: foundations and applications of implicit function types
Understanding a program entails understanding its context; dependencies, configurations and even implementations are all forms of contexts. Modern programming languages and theorem provers offer an array of constructs to define contexts, implicitly. ...
Scala macros: let our powers combine!: on how rich syntax and static types work with metaprogramming
SCALA '13: Proceedings of the 4th Workshop on ScalaCompile-time metaprogramming has been proven immensely useful enabling programming techniques such as language virtualization, embedding of external domain-specific languages, self-optimization, and boilerplate generation among many others.
In the ...
An experimental study of the influence of dynamic compiler optimizations on Scala performance
SCALA '13: Proceedings of the 4th Workshop on ScalaJava Virtual Machines are optimized for performing well on traditional Java benchmarks, which consist almost exclusively of code generated by the Java source compiler (javac). Code generated by compilers for other languages has not received nearly as ...






Comments