Java Magazine, September/October 2017
ORACLE COM JAVAMAGAZINE SEPTEMBER OCTOBER 2017 65 jvm languages leverage existing Java code This also means that there is no need to commit to a full rewrite if youd like to try the language you can write Clojure code alongside Java code and vice versa Immutability Is Fundamental As a functional programming language Clojure features a rich set of immutable and persistent data structures If you find yourself in need of mutable state you can leverage Clojures software transactional memory system and reactive agent system that ensure clean correct multithreaded designs On the subject of multithreading Clojure offers its async toolkit known as core async as part of the standard library Because it is loosely based on Gos concurrency model Clojure leads you to work intimately with channels Channels in Clojure operate with two principal activities you can take values from a channel and put values into a channel Digging into Clojures async merits an entire article if not a book I wont go into async in depth here but I would like to reiterate that Clojures async library is an elegant abstraction over threads Tooling and Community Clojures community is spearheaded by Rich Hickey the inventor of Clojure and the CTO of Cognitect Hickey is an experienced Java developer and has delivered numerous well received talks including especially his Simple Made Easy talk In fact the community at large has adopted this Simple Made Easy mantra when it comes to building libraries helping newcomers and fostering creativity With this idea in mind youll notice frameworks tend to be avoided in the Clojure community Its far more common to tell newcomers to piece together a few libraries to fit the need than to point them to the next big framework As a newcomer to the language this can seem intimidating especially if youve used large scale frameworks However with a bit of time and dedication youll not only be able to solve the problems you were looking to solve but youll have a stronger grasp on Clojure itself A very popular tool built by the community is Clojures de facto build tool Leinengen Leinengen aims to solve a similar problem that Gradle has solved for Java but it does much
You must have JavaScript enabled to view digital editions.