Live data from Hacker News

SICP in Clojure

sicpinclojure.com

31–40 of 62 posts

Re: SICP in Clojure

#32
post #24

Earlier quoted context omitted.

Maybe that is the reason why Clojure has growing industry adoption while scheme does not. Clojure used to have automatic promotion and all this stuff, but it was taken out in 1.3. BigInts are usful in a very small domain and Project Euler examples, not in many real applications. If you could start fresh and reprogramm your VM, JIT and GC, it would probebly be good idea to do full numeric tower, but in the real world…

Adoption of Java is a different issue, junk food chains are also enjoys growing adoption, so what?)

You are engaging in the ad populum fallacy fallacy.

That is, you wrongly believe that the popularity of a language isn't, in itself, evidence of its usefulness.

A lot of people making decisions on which language to use are very qualified and knowledgeable. When they choose clojure over scheme, they do it for good reasons.

Re: SICP in Clojure

#33

Earlier quoted context omitted.

Adoption of Java is a different issue, junk food chains are also enjoys growing adoption, so what?)

You are engaging in the ad populum fallacy fallacy. That is, you wrongly believe that the popularity of a language isn't, in itself, evidence of its usefulness. A lot of people making decisions on which language to use are very qualified and knowledgeable. When they choose clojure over scheme, they do it for good reasons.

If I am engaging in anything here, it is not this. You should take a look at my blog at least.)

Clojure is gaining popularity (along with Scala) because it makes living in the Java Ecosystem a bit less painful and disgusting. It has nothing to do with the "decline" (non-popularity) of Common Lisps and Schemes in so-called industry, but more with mediocrity of those for whom this very ecosystem was created and marketed in the first place.

Re: SICP in Clojure

#34
post #3

Does Clojure differ a lot from Scheme for what SICP teaches? Is there any benefit for studying the Clojure version of SICP, rather than the original?

Because the JVM doesn't have tail call optimization, Clojure doesn't allow you to do many of the exercises in SICP the way they were intended to be done, so it misses the point of SICP.

So for example: https://github.com/nickbauman/sicp/blob/master/src/section2_...

You'll see I solved the exercise by ignoring what they were trying to teach because it can't be done in Clojure they way they were trying to teach it. I did learn how to make a tree with only lists, which is cool.

Re: SICP in Clojure

#35
post #24

The irony is that in Clojure the classic, naive non-tail-recursive factorial procedure from SICP will first result in an Overflow Exception and then in Stack Overflow, while any other Schemes or Lisps could do (fact 1024) easily. Don't tell me that I should use some bigint type, the whole big idea behind the numeric tower is to do not bother with types.

Maybe that is the reason why Clojure has growing industry adoption while scheme does not. Clojure used to have automatic promotion and all this stuff, but it was taken out in 1.3. BigInts are usful in a very small domain and Project Euler examples, not in many real applications. If you could start fresh and reprogramm your VM, JIT and GC, it would probebly be good idea to do full numeric tower, but in the real world…

> Maybe that is the reason why Clojure has growing industry adoption while scheme does not

what is "that"? the lack of tail call optimization?

Re: SICP in Clojure

#36

The irony is that in Clojure the classic, naive non-tail-recursive factorial procedure from SICP will first result in an Overflow Exception and then in Stack Overflow, while any other Schemes or Lisps could do (fact 1024) easily. Don't tell me that I should use some bigint type, the whole big idea behind the numeric tower is to do not bother with types.

Only if (recur ...) is not used.

Sure it is a poor man's replacement, but it works.

Re: SICP in Clojure

#37
post #11

Clojure joke: 'knock knock!' - Who's there? 'minute of silence' 'Knock Knock!' - Who's there!? 'another minute of silence' - Java - Why did you knock twice? - I didn't, but some other suspicious guy is standing here with raised arm and mouth open. Based on my recent Clojure on Android experience.

Based on my recent Clojure on Android experience. As much as I wish Clojure on Android were a viable option, anyone with any sort of reading comprehension knows it's not. So while I don't doubt your criticism may have some sort of merit, you've managed to shoot your credibility in the foot, at least for this particular post.

by what "reading" do you make that claim? I recently saw a really cool game written in libgdx clojure. it looked and played great.

Re: SICP in Clojure

#38
post #16
post #12

Earlier quoted context omitted.

If had done some basic googling you wouldnot have needed to try it. Everybody know Clojure is not suited to this as it stands.

I'm able to hack fully working UI without restarting my app in minutes while you are still clicking at your first 'button' in XML. Startup time is very slow, but Android nature makes it 'faster' next time, because Android does not terminate applications on exit by default. So don't lie that 'it is not suited'. There are some fools that actually use it.

its not foolish too. I think some people posting here dont know android or clojure or both.

Re: SICP in Clojure

#39
post #3

Does Clojure differ a lot from Scheme for what SICP teaches? Is there any benefit for studying the Clojure version of SICP, rather than the original?

Yes, the differences are significant. The least reason is tail-call. The point is that Clojure is a very different language, abstracting many of the things that aren't abstracted in Scheme.

The idea of the book (at least in my interpretation) is that you are given a language with the absolute bare-minimum needed to built programs, thus why you can "learn Scheme in an afternoon." All of these things like (filter), hash-maps, dicts, etc, that we use and take for granted in our programs simply do not exist in Scheme unless you build it yourself.

In Scheme, you have to build up all the tools you need by creating your abstractions. To do this in Clojure (or any language) you have to ignore the abstractions you are given, and often must break the abstractions to create the abstractions you are already given.

Think of it this way. If you are going to be learning how to create and explore algorithms for matrix multiplication, would you prefer to use Mathematica or Python without Numpy?

Re: SICP in Clojure

#40
post #35
post #24

Earlier quoted context omitted.

Maybe that is the reason why Clojure has growing industry adoption while scheme does not. Clojure used to have automatic promotion and all this stuff, but it was taken out in 1.3. BigInts are usful in a very small domain and Project Euler examples, not in many real applications. If you could start fresh and reprogramm your VM, JIT and GC, it would probebly be good idea to do full numeric tower, but in the real world…

> Maybe that is the reason why Clojure has growing industry adoption while scheme does not what is "that"? the lack of tail call optimization?

Indirectly, yes. Lack of TCO is a byproduct of being on the JVM, but the JVM is the biggest reason why you can write production systems in Clojure today.
Post reply on HN