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.

SICP in Clojure

132 pointsby MattFalmost 10 years ago

11 comments

neoncontrailsalmost 10 years ago
I&#x27;ve been feeling the past few weeks the repeated impact of hitting a wall. Programming was starting to feel like grinding. I felt wistful for SICP, when programming was full of big ideas and elegant new approaches to problems my unprincipled brain&#x27;s first instinct was to clobber by brute force -- and learned, quickly, in Scheme, it&#x27;s <i>hard</i> to be artless. It is, I think, harder code gracelessly in Scheme than to code with grace: it has a way of bending your ideas to a form. I think that&#x27;s my main complaint with Python. In Python, exactly the opposite is true: it doesn&#x27;t force you to think overly hard about the <i>way</i> you solve problems, so you can solve more problems! Woohoo! You can Code Like Coltrane, as Rich Hickey says.<p>For better or for worse. Here&#x27;s an unfortunate side effect I&#x27;ve noticed: my programs are vastly more complex and efficient than when I graduated from SICP a year ago, which is good, and yet I can&#x27;t remember the last time I wrote code that was truly beautiful. Code I felt proud to call my code. Whose inner workings I could explain to a child. To me, <i>efficient</i> Python programs conceal so much of how they work, that striving for craftsmanship can feel alienating. It conceals so much. It&#x27;s like a black box magic trick: in goes the value... (pause) oh, and there&#x27;s the answer! And the obvious what&#x27;s happening in between those two points, the less efficient my solution tends to be. The prize winning solutions are often the most opaque, the most dense with imported methods. And my programs look inevitably kind of haphazard and provisional. Like doodles.<p>My Scheme programs, on the other hand, looked like Swiss clocks. They pleased me. They wouldn&#x27;t have worked any other way. They molded to the precise, regimented form they had to be. I understood them. They were good.<p>I like functional programming. I think the wall I&#x27;m hitting might be Python. The thought of a little Clojure or Haskell in my life right now sounds like a beach vacation.
评论 #10039339 未加载
评论 #10041449 未加载
评论 #10039828 未加载
评论 #10040478 未加载
评论 #10040185 未加载
评论 #10039399 未加载
评论 #10052013 未加载
评论 #10039313 未加载
评论 #10040304 未加载
评论 #10040069 未加载
markcalmost 10 years ago
There&#x27;s also <a href="http:&#x2F;&#x2F;ecmendenhall.github.io&#x2F;sicpclojure&#x2F;pages&#x2F;contents.html" rel="nofollow">http:&#x2F;&#x2F;ecmendenhall.github.io&#x2F;sicpclojure&#x2F;pages&#x2F;contents.htm...</a> which is an actual translation of the book into Clojure, currently up to chapter 2.1.4.<p>And the ill-fated sicpinclojure.com site, which looked beautiful and had such great promise, but mysteriously stalled and died.<p>Looks like vqc below has done quite a few of the exercises. Nice.<p>Tommy Hall&#x27;s SICP Distilled seems like the best shot at a complete book now. It&#x27;s running a bit behind schedule but appears to be in the home stretch. We&#x27;ll see!
rjberryalmost 10 years ago
Clojure seems too high level for SICP. Scheme was a perfect fit because of how simple it is and how few language features or data structures it contained. You had to build everything yourself, which was kind of the point.
bogomipzalmost 10 years ago
This is awesome! I would love to see this span the whole SICP book.<p>There was a kickstarter campaign for something called SICP Distilled, a while back. However it requires your github login which seemed kind of sketchy and also none of the content works anyway - <a href="http:&#x2F;&#x2F;www.sicpdistilled.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.sicpdistilled.com&#x2F;</a>. Maybe someone else knows more?<p>Anyway I look forward to seeing more chapters on your blog.
lrcalmost 10 years ago
I&#x27;ve spent a lot of time with SICP and with Clojure. The book changed my life, and I too considered working on &quot;porting&quot; the book, but there would be a considerable amount of friction. Clojure can do everything necesssary, but it&#x27;s very unidiomatic to build data structures out of pairs in Clojure, and SICP spends a _lot_ of time implementing data structures with pairs. A reconsideration of SICP for the modern age would, I think, take vectors and maps and sets as given, and see what _additional_ magic could be built from there!<p>Just start with sequences. Lazy sequences, which are so helpful in the expert system database that&#x27;s built in SICP, are already right there in Clojure without the complications of force and delay. My thought is you could do a lot more with the higher level examples, but a lot of the first half of the book would have to be rethought. (The functional implementation of Conway&#x27;s Life in O&#x27;Reilly&#x27;s &quot;Clojure Programming&quot; is as good as anything in the first third of SICP, for example; the example of accelerating series convergence from SICP seems less exciting today than it used to, at least to me.)
sbensualmost 10 years ago
To the author: on the compound data structures example, it would be much better to return an anonymous function with `fn` than to use `defn`. `defn` is meant to add global definitions to the namespace, not to be used as a value.
评论 #10039860 未加载
ninjakeyboardalmost 10 years ago
“I personally don&#x27;t think SICP will help you much with Clojure. YMMV.”<p>—Rich Hickey, author, Clojure programming language
评论 #10042025 未加载
rachbowyeralmost 10 years ago
For those people in London (England) interested in SICP in Clojure, we are running a monthly study group. Our google groups group is <a href="https:&#x2F;&#x2F;groups.google.com&#x2F;forum&#x2F;#!forum&#x2F;sicp-mailonline" rel="nofollow">https:&#x2F;&#x2F;groups.google.com&#x2F;forum&#x2F;#!forum&#x2F;sicp-mailonline</a> and the code is at <a href="https:&#x2F;&#x2F;github.com&#x2F;MailOnline&#x2F;sicp-mailonline" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;MailOnline&#x2F;sicp-mailonline</a> (each person has their own branch).<p>We are just starting Chapter 3 and at the current rate of progress it will be at least a year before we have completed the entire book!<p>Anyone interested is welcome to join us :-)
ericmoalmost 10 years ago
There was another person doing SICP in Clojure too, but it&#x27;s been frozen in chapter 2 for a couple of years now. <a href="https:&#x2F;&#x2F;github.com&#x2F;ecmendenhall&#x2F;sicpclojure" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ecmendenhall&#x2F;sicpclojure</a><p>Hope this one gets to cover the whole book.
评论 #10040866 未加载
vqcalmost 10 years ago
This is exciting; I&#x27;ve been looking forward to doing this exact thing myself.<p>Some more solutions can be found at <a href="https:&#x2F;&#x2F;github.com&#x2F;gregsexton&#x2F;SICP-Clojure" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gregsexton&#x2F;SICP-Clojure</a>
provemewrongalmost 10 years ago
The link to previos charpter in the blog post 404&#x27;s (but I could navigate to it through the sidebar). Anyway, I&#x27;m looking forward to reading them when I get home and hope to see the following charpters as well.
评论 #10039536 未加载