InfoQ

Interview

Recorded at:
Recorded at

Rich Hickey on Clojure's Features and Implementation

Interview with Rich Hickey by Werner Schuster on May 25, 2009

Community
Architecture,
Ruby,
Java
Topics
Language ,
Performance & Scalability ,
Compilers ,
Language Design ,
Dynamic Languages
Tags
QCon ,
LISP ,
Clojure ,
STM ,
QCon London 2009 ,
Scalability
Summary
In this interview taped at QCon London 2009, Rich Hickey talks about all things Clojure: Software Transactional Memory, concurrency, persistent data structures, ports, AOT compilation, and more.

Bio
Rich Hickey, the author of Clojure, is an independent software designer, consultant and application architect with over 20 years of experience in all facets of software development.

About the conference
QCon is a conference that is organized by the community, for the community.The result is a high quality conference experience where a tremendous amount of attention and investment has gone into having the best content on the most important topics presented by the leaders in our community. QCon is designed with the technical depth and enterprise focus of interest to technical team leads, architects, and project managers.
We are here at QCon London 2009, with Rich Hickey. Rich, who are you?
What brought you to create a Lisp? Do you go out in the morning and say "Hey, I'm bored! Let's create the Lisp!"? What's the intention behind it?
It sounds like a good idea. You mentioned a thing you had a problem with: object oriented programming. Is that the right way to say that?
Are you more interested in object oriented model that is closer to what Erlang does, sort of an actor style, or like Common Lisp, or what would you be interested in? Would you say you use object oriented programming?
You mentioned transactions, which brings us to STM - Software Transactional Memory. What's your elevator pitch for STM?
What's your elevator explanation of STM? What's would be a short explanation of what goes on in your STM implementation? What happens?
Can STM throw threads or should it be on the same thread all the time?
Is it possible to implement it on several threads because it could solve some problems in the web? We have several requests and, if we could span transactions to several threads, it could solve some problems when we have partial states on several requests coming from the web. Do you think it could be possible to span several threads with the transaction?
About STM again: is there any label for your STM? Is there any keywords that describe the STM? I saw you had the acronym MVCC.
You talked about readers not impeding writers. Does that mean if I read from a reference, which is the STM construct you use, there is no locking? Is that right?
You already mentioned persistent data structures. Maybe you could give a short explanation?
You offer persistent Data structures for vectors?
Do they have the same access characteristics as the Java collections?
You mentioned in your talk yesterday about Clojure that you had agents and references and atoms. What would you call them? Concurrency primitives?
You said you had 4 right now and you were going to add a 5th? Could we have the exclusive information: what's the 5th one?
One of your constructs is agents. What's a short explanation for agents? What do you use them for?
So agents are reactive?
I saw a thing on the news group or your mailing list that some people are working on the implementation of cells, which is - I think - a GUI framework using data flow methods?
You said "concurrent implementation of cells or of these features". What do you mean by that?
Let's move on to some other language features in Clojure. I saw a very interesting feature called metadata. What do you do with it? How do you use it?
That's an interesting feature, because the language is like Perl or Ruby who have the "tainted" feature. If you get a string or data from the net, its marked as "tainted" It's a special feature in String or wherever it's defined, so you could do that with metadata.
Do you currently support metadata on symbols?
Did you plan to add it more constructs or will that be limited?
Because string is the native string type in Java.
Would that be the same for numbers?
Metadata is always just data, it never directly influences the evaluation of the code, at least for Clojure?
Moving on to another feature that brings polymorphism to Clojure, multimethods - to an object oriented programmer, how would you explain multimethods?
How does the dispatch function work? What does it return? Does it find a function to execute or how does it work?
You mentioned this isa? function, which is basically for checking equality between these symbols?
Can I modify this isa? too or is that hard coded for these hierarchies and Java classes?
What kind of hierarchies can you define? Can you define multi-inheritance?
Can you define graphs, too or just trees?
Dispatching on several parameters of the function when you call it and you have hierarchies and you get more chances to find more than one candidate for the call, how do you reason about which one to choose and what to do with it?
Can the dispatch functions see all the dispatch values that have been defined for multimethod so it can build a more efficient way of lookup?
Clojure works currently on the JVM, but I think there are other implementations for Clojures or ports?
The Java core or the Clojure core?
Is Clojure written in Clojure or in Java source code?
You have ahead of time compilation - AOT - with Clojure. What happens if AOT compile something? Do you still need a Clojure Runtime for that or are the class files that it creates self-contained?
What kind of capabilities do you need for implementing Clojure? If you have things like STM, do you need special concurrency features, do you need some kind of atomic instructions or anything like that?
Currently, at the time of this recording, Clojure is not 1.0 yet. What would be the features that would make it 1.0? what are you going to add, what are you going to modify to go to 1.0? When do you declare it 1.0, to put it this way?
You were recently doing some work on redefining the way laziness works, streams work. What's the current status of that? What the current idea of laziness in Clojure?
I think you previously mentioned type hints on functions. I think I saw something about Clojure being able to do fast math or compile to fast math in Java - how does that work? How fast can you get?
I say some variable is an int, 32 bit in, but you still do you the overflow check. Do you have a number tower in Lisp? Does it expand the width of the type or do you just have type int?
What do you use to implement Clojure? What kind of tools do you use?
show all  show all
(great 'stuff) by Paul Gresham Posted Jun 3, 2009 2:13 AM
  1. Back to top

    (great 'stuff)

    Jun 3, 2009 2:13 AM by Paul Gresham

    Thanks Rich & Werner. For me, Clojure is the most exciting technology out there today. Exciting in itself, but I also can't wait to see what people do with it (are able to do with it). It's certainly the first viable alternative for moving 'hard' problems off of common lisp and the rich libraries of Java are definitely attractive. Would have liked some information on performance of multi-dimensional arrays (an Achilles heel for Java).

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.