Paul Krill
Editor at Large

Programmers could get REPL in official Java

news analysis
Sep 3, 20142 mins

Featured in Lisp programming, REPL expressions cut compilation overhead in looping operations

Proponents of open source Java are investigating the possibility of formally adding a REPL (Read Evaluate Print Loop) tool to the language.

Java advocates are considering REPL as part of Project Kulla, currently under discussion on the openjdk mailing list for open source Java. Featured in Lisp programming, REPL expressions replace entire compilation units; the REPL evaluates them and offers results. With REPL, the overhead of compilation is avoided for looping operations, says Forrester analyst John Rymer.

“From a developer perspective, it’s nice to be able to interact with the code while it’s running in real time without having to recompile/redeploy,” analyst Michael Facemire, also of Forrester, says.

REPLs already are featured in most dynamic and functional languages, including Scala, says Scala founder Martin Odersky in an email. There have even been REPLs available for Java before, he says. A Java REPL implementation has been available online and forkable on GitHub.

But Odersky sees limits with using REPL in Java. “The problem for Java here is that it is a fundamentally statement-oriented language. You write a statement, and when it executes, it has an effect,” he says. “REPLs by contrast are expression-oriented: You write an expression, and the REPL shows the result, much like a calculator would. While a REPL is certainly possible for Java, it won’t be as useful as for an expression-oriented language.”

Facemire, however, expects REPL to “be in vogue before you know it,” with new languages like Apple’s Swift supporting it.

Code cloned from the Java Development Kit 9 repository would be featured in Project Kulla. Votes on the proposal are being taken on the mailing list until Sept. 10. Oracle technologists familiar with the proposal did not respond to an inquiry on Tuesday.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author