Programmers could get REPL in official Java

Java could add read-evaluation-print-loop tool as part of Project Kulla, but analysts wonder if it's a good fit

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.

This story, "Programmers could get REPL in official Java," was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

From CIO: 8 Free Online Courses to Grow Your Tech Skills
Join the discussion
Be the first to comment on this article. Our Commenting Policies