TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introducing HipHip (Array): Fast and flexible numerical computation in Clojure

93 pointsby trevoragilbertalmost 12 years ago

13 comments

adrianmalmost 12 years ago
I do not believe this is the right approach to the problem, but I do appreciate the problem you&#x27;re trying to solve here. However, in my opinion - Clojure libraries shouldn&#x27;t be trying to reinvent the wheel. If your goal is to expose a better interface for vector arithmetic in Clojure - write a library that does that really well.<p>But if your primary concern is performance, please don&#x27;t roll your own vector or matrix &quot;native&quot; interface. You will certainly never come close in speed to what has come before (BLAS implementations galore, et al). Also it&#x27;s just a lot of work that is basically keeping you from working on the higher order problems out there that we desperately need to tackle.<p>If your goal is more &quot;Clojurey&quot; syntax then just spend a day or two wrapping the functions you want over a tried and tested numerics implementation. Additionally, there is likely a pre-existing Java wrapper which does just that for whatever you need considering that Java is still beloved by university professors, a key demographic for fast math libraries.<p>On the other hand, I think Vertigo ( github: <a href="https://github.com/ztellman/vertigo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ztellman&#x2F;vertigo</a> ) is taking a very interesting approach to the Clojure-&gt;Native problem, which I believe might be of use to any library wanting to bring performant numerics to Clojure. Unfortunately, ztellman has deprecated his OpenGL and OpenCL libraries, but I think that Vertigo in combination with OpenCL and the kernels courtesy of clMAGMA would be fantastic.
评论 #6023395 未加载
评论 #6028541 未加载
vemvalmost 12 years ago
<p><pre><code> All arithmetic operations on these boxed objects are significantly slower than on their primitive counterparts. This implementation also creates an unnecessary intermediate sequence (the result of the map), rather than just summing the numbers directly. </code></pre> Clojure&#x27;s Reducers framework might address the described issues in a future when, in Rich&#x27;s words, &quot;those IFn.LLL, DDD etc primitive-taking function interfaces spring to life&quot;. For now, they only solve the intermediate-collections part of the problem.
评论 #6022116 未加载
w01fealmost 12 years ago
One of the authors here. We&#x27;re excited to hear your feedback on hiphip, and will be around all day to read feedback and answer questions.
评论 #6021737 未加载
评论 #6022111 未加载
评论 #6021678 未加载
peatmossalmost 12 years ago
Looks awesome! One data issue I&#x27;ve seen go relatively unaddressed in the Clojure community is the serialization of big matrices and arrays.<p>There&#x27;s a start on a clojure hdf5 (hdf5 is a container format common in scientific circles) implementation, but it&#x27;s a long ways from done. <a href="https://github.com/clojure-numerics/clj-hdf5" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;clojure-numerics&#x2F;clj-hdf5</a> I&#x27;m not the author, but I am the negligent steward.<p>I&#x27;d love it if someone smarter &#x2F; better at Clojure than me was interested in helping to think about useful, idiomatic high-level abstractions on top this high-performance data store.<p>PyTables does a great job of making gobs of hdf5 data easy to work with for analysts--I&#x27;m just too novice at Clojure&#x2F;FP to know what is a reasonable analogue for Clojure.
评论 #6021987 未加载
评论 #6028482 未加载
51Cardsalmost 12 years ago
Love the project et. all, this would be very helpful!<p>I have to comment on the name as well... brilliant. Kudos for something creative that has already stuck firmly in my mind.
评论 #6022193 未加载
netshadealmost 12 years ago
Cool library, can imagine how moving away from boxing &#x2F; unboxing can be a huge boost for them.<p>I&#x27;ve been looking for something that gave SIMD intrinsics to Java programmers - does anyone know if such a thing exists? Could be a nice addition to this lib.
评论 #6022157 未加载
Historiopodealmost 12 years ago
What brought you to develop this library rather than relying on Incanter&#x2F;Colt? The scope of HipHip seems different, of course, but there is enough of an overlap to warrant the question.
评论 #6022200 未加载
mjwalmost 12 years ago
Did you guys look at the core.matrix API?<p><a href="https://github.com/mikera/matrix-api" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mikera&#x2F;matrix-api</a>
评论 #6023081 未加载
fiatmoneyalmost 12 years ago
One thing I&#x27;ve found is that with macros, it can actually be easier to write performant primitive-reliant code. Still not up to Common Lisp standards, but much better than, eg, having to use a scripting language to generate all the primitive specializations of your data structure, like Trove and Fastutil do.
评论 #6022189 未加载
tick113almost 12 years ago
Having written my own naive Clojure dot product, I can definitely appreciate what you guys have done!<p>Any plans to attack sparse vectors? Performance on the sparse vector operations I wrote was poor, but being new to Clojure it wasn&#x27;t a great implementation.
评论 #6022096 未加载
评论 #6028581 未加载
bryansumalmost 12 years ago
FYI: your link to the GitHub project halfway down the article is broken.
评论 #6022160 未加载
wavesoundsalmost 12 years ago
I just got it &#x27;Hip Hip Hurray&#x27; ... haha :-)
zinxqalmost 12 years ago
As an interesting aside, you can nearly double the speed of your Java loop by unrolling it a few times. (at least it did that for me in JDK 7)
评论 #6023600 未加载