Paul Krill
Editor at Large

Clojure 1.10 upgrade supports modern Java

news
Dec 19, 20182 mins

Functional JVM language offers more detail on programming errors

java giftbox present gift surprise programmer code laptop devops
Credit: Eclipse Images / Getty Images

Clojure 1.10, an upgrade to 11-year-old language that has brought functional programming to the JVM, improves Java compatibility and error reporting.

While Clojure is best-known for its Java tie-in, it also has been extended to other platforms. Clojure CLR supports the language on Microsoft’s Common Language Runtime, while ClojureScript is a compiler that lets Clojure developers compile their code to JavaScript.

Where to download Clojure 1.10

You can download Clojure 1.10 from the Clojure downloads webpage.

What’s new in Clojure 1.10

Version 1.10 supports Java 8 through Java 11. It updates the module system introduced in Java 9, fixes bytecode-related bugs, and removes deprecated APIs.

Error reporting at the REPL (read-eval print loop) now categorizes errors based on the phase of execution, such as read, compile, and macroexpand. Additional information is provided about location and context as data. Phase-specific error messages are provided, with better location reporting. While this functionality is built into the clojure.main REPL, it also is available for other REPLs and tools, and developers can use and modify the data to produce improved error messages.

Other capabilities in Clojure 1.10 include:

  • defprotocol, used for defining a named set of methods and their signatures, has a new option, :extend-via-metadata. When this option is true, values can extend protocols by adding metadata where keys are qualified protocol function symbols and values are function implementations.
  • tap provides a shared system for distributing information or diagnostic to a set of handler functions. It can be used to debug the core prn capability or for facilities such as logging.
  • The read+string function mimics read but also captures the string that is read and returns both the read value and the read string.
  • A pre-beta version of Prepl provides a stream-based REPL with structured output, suitable for programmatic use.
  • The clojure/datafy facility for object-to-data transformation has the datafy and nav functions for transforming and navigating through object graphs.
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