Past Meetup

#8 Peter Burka - Crossing the Gap from Imp. to Func. Prog. through Refactoring

This Meetup is past

97 people went

Location image of event venue

Details

We're excited to have Peter Burka , member of the software research team at Two Sigma (http://www.twosigma.com/), presenting on Crossing the Gap from Imperative to Functional Programming through Refactoring (http://dig.cs.illinois.edu/papers/lambdaRefactoring.pdf) by Alex Gyori, Lyle Franklin, Danny Dig, and Jan Lahoda.

Intro

The introduction of lambdas to Java 8 might be the most significant change to the Java language since Java 2 was released in 1998. Lambdas and the accompanying functional operations like map and filter promise to allow Java programmers to write clearer, simpler code, and to take better advantage of parallelism.

While developers of new code will be able to start using the features immediately, what should we do with the billions of lines of code that have already been written? This paper proposes that we can automatically translate the existing body of Java code to make use of the new features. This improves the readability of the old code, maintains consistency between new and old code, and potentially improves performance.

This paper addresses technical debt, an area of software engineering which is only starting to be addressed in academic literature. The authors solve a practical and important problem with a powerful technical tool.

Bio

Peter Burka (@pburka (https://twitter.com/pburka)) is a member of the software research lab at Two Sigma Investments. He’s interested in many areas of software development, and has recently been dividing his time between exploring programming for many-core devices and finding ways to address technical debt through automation. Previously, he helped develop IBM’s J9 Java virtual machine, where he built the balanced garbage collector and ported the JVM to Palm Pilot, among other achievements. Peter has a great fondness for Smalltalk and is pleased that, 35 years on, its influence can still be seen in so many languages and systems.

Paper Abstract

Java 8 introduces two functional features: lambda expressions and functional operations like map or filter that apply a lambda expression over the elements of a Collection. Refactoring existing code to use these new features enables explicit but unobtrusive parallelism and makes the code more succinct. However, refactoring is tedious: it requires changing many lines of code. It is also error-prone: the programmer must reason about the control-, data-flow, and side-effects. Fortunately, refactorings can be automated. We designed and implemented LambdaFicator, a tool which automates two refactorings. The first refactoring converts anonymous inner classes to lambda expressions. The second refactoring converts for loops that iterate over Collections to functional operations that use lambda expressions. Using 9 open-source projects, we have applied these two refactorings 1263 and 1709 times, respectively. The results show that LambdaFicator is useful: (i) it is widely applicable, (ii) it reduces the code bloat, (iii) it increases programmer productivity, and (iv) it is accurate.

Details

Doors open at 7 pm; the presentation will begin at 7:30 pm; and, yes, there will be beer, water, and pizza.

After Peter presents the paper, we will open up the floor to discussion and questions.

We hope that you'll read the paper before the meetup, but don't stress if you can't. If you have any questions, thoughts, or related information, please visit our *github-thread (https://github.com/papers-we-love/papers-we-love/issues/175)* on the matter.

Additionally, if you have any papers you want to add to the repository above (papers that you love!), please send us a pull request (https://github.com/papers-we-love/papers-we-love/pulls). Also, if you have any ideas/questions about this meetup or the Papers-We-Love org, just open up an issue.