Live data from Hacker News

SICP in Clojure

sicpinclojure.com

21–30 of 62 posts

Re: SICP in Clojure

#21
post #19

Could we stop posting this please? It is a fantastic idea, but is incomplete and not worked on much at all. http://news.ycombinator.com/item?id=7078660 http://news.ycombinator.com/item?id=900865 http://news.ycombinator.com/item?id=1425203 http://news.ycombinator.com/item?id=6843719 http://news.ycombinator.com/item?id=2701414 http://news.ycombinator.com/item?id=4112852

Also when will people understand that SICP is not about teaching programming language? There is no fucking point in rewriting it in your favourite language, it is 99.9% your language less suitable for it (99% it already has mutable state, assignment, loops, (pseudo-)OOP and 5 layers of historic brain damage) Don't know scheme? But it's even better that way! Many things will faster click in your head. Like oh wtf we'r…

Scheme and/or Common LISP seem to be the common recommendation to embark on SICP journey, just for reference.

Re: SICP in Clojure

#22
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.

Re: SICP in Clojure

#23
post #19

Could we stop posting this please? It is a fantastic idea, but is incomplete and not worked on much at all. http://news.ycombinator.com/item?id=7078660 http://news.ycombinator.com/item?id=900865 http://news.ycombinator.com/item?id=1425203 http://news.ycombinator.com/item?id=6843719 http://news.ycombinator.com/item?id=2701414 http://news.ycombinator.com/item?id=4112852

Also when will people understand that SICP is not about teaching programming language? There is no fucking point in rewriting it in your favourite language, it is 99.9% your language less suitable for it (99% it already has mutable state, assignment, loops, (pseudo-)OOP and 5 layers of historic brain damage) Don't know scheme? But it's even better that way! Many things will faster click in your head. Like oh wtf we'r…

> it already has mutable state, assignment, loops, (pseudo-)OOP and 5 layers of historic brain damage

You mean like Scheme, right? It's got all that, plus an extra couple of layers now that there's R7RS.

Re: SICP in Clojure

#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 you have constraints and you cant be pure.

Re: SICP in Clojure

#25
I remember when "SICP in X" was a thing some years ago. I thought I might as well do a version in a language I use, so I found a text version of the exercises and got to work. I lasted all of 1.5 chapters before passing out from boredom. If translating a bunch of examples of what you can do with lexical scope and singly-linked lists is your thing, go for it, but I'll pass.

Re: SICP in Clojure

#26

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.

[deleted]

Re: SICP in Clojure

#27
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…

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

Re: SICP in Clojure

#28

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.

To auto-promote to BigInt in case of an overflow, use a quote after the star(multiplier) operator. Since HN is not allowing me to use star in this comment here is the link to the gist with a simple factorial example: https://gist.github.com/devasiajoseph/8485836

Re: SICP in Clojure

#29
post #21
post #19

Earlier quoted context omitted.

Also when will people understand that SICP is not about teaching programming language? There is no fucking point in rewriting it in your favourite language, it is 99.9% your language less suitable for it (99% it already has mutable state, assignment, loops, (pseudo-)OOP and 5 layers of historic brain damage) Don't know scheme? But it's even better that way! Many things will faster click in your head. Like oh wtf we'r…

Scheme and/or Common LISP seem to be the common recommendation to embark on SICP journey, just for reference.

Especially scheme, because it's the language used in the original edition.

Re: SICP in Clojure

#30

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.

To auto-promote to BigInt in case of an overflow, use a quote after the star(multiplier) operator. Since HN is not allowing me to use star in this comment here is the link to the gist with a simple factorial example: https://gist.github.com/devasiajoseph/8485836

Again, the point is precisely in having just one star.
Post reply on HN