r/programming • • Apr 13 '14

Puppet Labs move to Clojure

http://puppetlabs.com/blog/new-era-application-services-puppet-labs
101 Upvotes

30 comments sorted by

View all comments

16

u/strattonbrazil Apr 13 '14

I wish they mentioned performance a bit more. From my personal experiences and almost every benchmark I've ever seen clojure struggles and seems laborious to optimize unless you have a lot of experience with it. I guess it might be comparable to ruby, so it didn't affect them. In my brief use of clojure, the language was very simple and the docs were very easy to use.

21

u/Plorkyeran Apr 13 '14

Even if Clojure was consistently half the speed of the equivalent code in Java, it'd still be a huge step up in performance from Ruby.

3

u/lacosaes1 Apr 13 '14

If they're going to rewrite something for performance, why don't pick a language with a very good performance on the JVM like Scala?

12

u/grim_radical Apr 13 '14

We'd already written PuppetDB in Clojure a while ago, and thus have several years' experience with the language. It's been fast enough and practical enough for our needs, and a pleasure to use. This is not a knock against Scala, which is also a great language.

7

u/lacosaes1 Apr 13 '14

... and thus have several years' experience with the language.

Fair enough. That's a big reason.

4

u/roybatty Apr 13 '14

The article didn't mention anything about performance really (except the JVM itself). And besides that what makes you think that Clojure doesn't have good performance?

-7

u/lacosaes1 Apr 13 '14

They're abandoning Ruby because its performance is shit so yeah, performance is the big factor here. Now what I'm saying is that you're rewriting shit because you need performance and you're picking the JVM, why not rewrite it in Scala?

6

u/roybatty Apr 13 '14

The programming language we chose for PuppetDB is Clojure, and we’ve been moving towards adopting Clojure for most of our new back-end projects.

I'm assuming they took a look at Scala, didn't like it, like Clojure as a language, and Clojure performance is within their performance requirements. They can always dip down into Java anyway if they need to squeeze out some more performance.

3

u/vivainio Apr 13 '14

It doesn't seem like they are rewriting stuff, but rather picking up Clojure for new projects. It's a ruby shop, so speed is probably not a big concern for them in the first place.

0

u/s_m_c Apr 14 '14

JRuby has good performance on the JVM and will improve further with the maturing of invoked dynamic.

-2

u/revscat Apr 13 '14

But not JRuby. I'd be curious to know what made them decide to go with Closure rather than JRuby, especially given that Puppet is primarily a Ruby shop.

17

u/TJSomething Apr 13 '14

1

u/[deleted] Apr 14 '14

Which points to some issue in the Ruby object/dispatch model that causes this slowness. Can't blame JRuby's performance on GC or threads in the case of JRuby.

4

u/lynxbat Apr 13 '14

They do use JRuby for their Razor project via Torquebox