Woah. I've been wanting to finish SICP book along with MIT lectures and this site looks like another great addition. This gives me a boost in motivation to finish the book.
If someone ever comes up for something like this for Clojure then it would be incredibly awesome.
Whoa! ISICP looks really cool! You know, the exercise sections of ISICP remind me a lot of the interactive Clojure exercises at 4Clojure.com. 4Clojure.com has a link to the github repo of the software used to create the site.
I believe there's a lack of clarity in the let form explanation:
=>(let [object "light"]
=> (let [object "darkness"])
=> (println (str "God said let there be " object)))
God said let there be light
nil
'object' is overwritten but only within the second let form:
=>(let [object "light"]
=> (let [object "darkness"]
=> (println (str "God said let there be " object))))
God said let there be darkness
nil
or even:
=>(let [object "light"]
=> (println (str "God said let there be " object))
=> (let [object "darkness"]
=> (println (str "God said let there be " object))))
God said let there be light
God said let there be darkness
nil
The reason for this is the let form uses lexical scoping. In other words it creates a new frame which includes the bindings declared in the square brackets. When 'object' is evaluated its binding is looked for in the current frame, then the frame that called that frame and all the way out into the global namespace stopping when a binding is found.
This would be better for illustrating that object is not overweritten, I think:
=>(let [object "light"]
=> (let [object "darkness"]
=> (println (str "God said let there be " object)))
=> (println (str "God said let there be " object)))
God said let there be darkness
God said let there be light
nil
Clojure has always been slightly disappointing for me...
The principles behind its design are all sound and Rich Hickey deserves credit for putting in the hard thought behind it.
... but.... the reality seems to be of a really under performing language. The forums are consistently full of people with 'why is this slow?' to which the solution is always 'Give it more hints' or 'do it in a more Java like way'.
Unfortunately the Clojure stack seems not to have much mechanical sympathy (despite its best intentions). It seems the natural/idiomatic way to use Clojure results in far too much dynamic behavior to be performant.
Clojure may scale well, but its inherent bad performance (without lots of work) is a major downside.
I forget who said this, but it seems very appropriate to Clojurists... "Show me you can use one machine well before you get another..."
In my experience, Clojure performs rather well. I used to use Python for what I now use Clojure and it seems to outperform that.
Sure, Java and C++ perform better still. I don't feel like Clojure is trying to compete with them on performance, rather Clojure is competing with the dynamic languages and allows you to drop down to lower levels (type hints, Java interop) when you do need more performance. Developer productivity first, performance second.
If I need C++ performance, then I use C++ because few languages can compete with that, but for most of my work (web development), I don't need to.
Unfortunately the Clojure stack seems not to have much mechanical sympathy (despite its best intentions). It seems the natural/idiomatic way to use Clojure results in far too much dynamic behavior to be performant. Clojure may scale well, but its inherent bad performance (without lots of work) is a major downside.
This is simply untrue for most applications. I've been using Clojure and ClojureScript in production for more than two years now on a web app (front-end CLJS, back-end Clojure) and I've never had problems with it being sluggish for what I've needed to do.
When something isn't performing well enough, it's easy to profile and optimize, but in terms of building stuff out this is not something I have to think about; I focus on choosing the right data structures and abstractions. Of course, it's possible to slow things down simply by writing non-idiomatic code when you are first getting used to it (I speak from experience)--but that's not Clojure's fault: it's quite different from most mainstream languages and there is a learning curve.
For applications where you need performance like native Java, then sure, you need to optimize--add type hinting, use Java's mutable data structures, and more. I can't say too much about it because I'm not an expert on optimizing Clojure for high performance--I don't have to be.
I aggree. I love the language and concepts, but at some point, after two months of learning it, I've got fed up with the slugishness of the whole thing and gave up because I have no idea what to do with it.
I also found it a very difficult language to learn. I felt like I was taking baby steps every day, although I was giving it all I could. I felt stupid and frustrated to the point that I'm actually considering quitting the profession, because, well, I'm not good enough for this.
Contrast that with Objective-C which I learned last year - it took me a couple of weeks to become profficient and start writing real world, commercial apps which I can sell. Maybe 15 years of daily C++ programming has had something to do with it, but still.
I struggle to imagine a practical project which I could use clojure for.
Front end, user-facing apps, utilities, system tools - forget it - an app takes 15 seconds to load and uses gigabytes of RAM.
Backend - maybe, but there are a lot of other languages and frameworks out there which are really powerful and have huge communities.
So I don't know, I really love clojure, but the JVM just doesn't cut it for me. I want a C++ version of Clojure, which I was thinking about starting every single day I was learning it.
[+] [-] jonnybgood|10 years ago|reply
[0] http://xuanji.appspot.com/isicp
[+] [-] fierycatnet|10 years ago|reply
If someone ever comes up for something like this for Clojure then it would be incredibly awesome.
[+] [-] elangoc|10 years ago|reply
[+] [-] lewisl9029|10 years ago|reply
http://www.clojurescreencasts.com/koans-walkthrough/01.html
[+] [-] nerd_stuff|10 years ago|reply
I believe there's a lack of clarity in the let form explanation:
'object' is overwritten but only within the second let form: or even: The reason for this is the let form uses lexical scoping. In other words it creates a new frame which includes the bindings declared in the square brackets. When 'object' is evaluated its binding is looked for in the current frame, then the frame that called that frame and all the way out into the global namespace stopping when a binding is found.See also: http://stackoverflow.com/questions/1774417/scoping-rules-in-...
[+] [-] fnordsensei|10 years ago|reply
[+] [-] kimh|10 years ago|reply
http://kimh.github.io/clojure-by-example/#scope
[+] [-] unknown|10 years ago|reply
[deleted]
[+] [-] kimh|10 years ago|reply
I found Slate is very easy to use and customize!!
[+] [-] hoprocker|10 years ago|reply
(I know I know, there are plenty of other ways to access a Clojure REPL!)
[+] [-] TickleSteve|10 years ago|reply
The principles behind its design are all sound and Rich Hickey deserves credit for putting in the hard thought behind it.
... but.... the reality seems to be of a really under performing language. The forums are consistently full of people with 'why is this slow?' to which the solution is always 'Give it more hints' or 'do it in a more Java like way'.
Unfortunately the Clojure stack seems not to have much mechanical sympathy (despite its best intentions). It seems the natural/idiomatic way to use Clojure results in far too much dynamic behavior to be performant. Clojure may scale well, but its inherent bad performance (without lots of work) is a major downside.
I forget who said this, but it seems very appropriate to Clojurists... "Show me you can use one machine well before you get another..."
[+] [-] dkersten|10 years ago|reply
Sure, Java and C++ perform better still. I don't feel like Clojure is trying to compete with them on performance, rather Clojure is competing with the dynamic languages and allows you to drop down to lower levels (type hints, Java interop) when you do need more performance. Developer productivity first, performance second.
If I need C++ performance, then I use C++ because few languages can compete with that, but for most of my work (web development), I don't need to.
[+] [-] ddellacosta|10 years ago|reply
This is simply untrue for most applications. I've been using Clojure and ClojureScript in production for more than two years now on a web app (front-end CLJS, back-end Clojure) and I've never had problems with it being sluggish for what I've needed to do.
When something isn't performing well enough, it's easy to profile and optimize, but in terms of building stuff out this is not something I have to think about; I focus on choosing the right data structures and abstractions. Of course, it's possible to slow things down simply by writing non-idiomatic code when you are first getting used to it (I speak from experience)--but that's not Clojure's fault: it's quite different from most mainstream languages and there is a learning curve.
For applications where you need performance like native Java, then sure, you need to optimize--add type hinting, use Java's mutable data structures, and more. I can't say too much about it because I'm not an expert on optimizing Clojure for high performance--I don't have to be.
[+] [-] codeshaman|10 years ago|reply
I also found it a very difficult language to learn. I felt like I was taking baby steps every day, although I was giving it all I could. I felt stupid and frustrated to the point that I'm actually considering quitting the profession, because, well, I'm not good enough for this.
Contrast that with Objective-C which I learned last year - it took me a couple of weeks to become profficient and start writing real world, commercial apps which I can sell. Maybe 15 years of daily C++ programming has had something to do with it, but still.
I struggle to imagine a practical project which I could use clojure for.
Front end, user-facing apps, utilities, system tools - forget it - an app takes 15 seconds to load and uses gigabytes of RAM.
Backend - maybe, but there are a lot of other languages and frameworks out there which are really powerful and have huge communities.
So I don't know, I really love clojure, but the JVM just doesn't cut it for me. I want a C++ version of Clojure, which I was thinking about starting every single day I was learning it.
[+] [-] mayneack|10 years ago|reply
[+] [-] elwell|10 years ago|reply
[+] [-] melipone|10 years ago|reply
[+] [-] josebaezmedina|10 years ago|reply
[+] [-] thomas11|10 years ago|reply
[+] [-] hajims|10 years ago|reply
[+] [-] icey|10 years ago|reply
[+] [-] elangoc|10 years ago|reply
The target audience is people with prior programming experience. It's important to know the target audience, either as a writer or reviewer.
The tutorial webpage is simple and effective with a gradual progression in concept difficulty.
I hope we have more things like this! Thanks!
[+] [-] fierycatnet|10 years ago|reply
[+] [-] dvliman|10 years ago|reply
[+] [-] pvdebbe|10 years ago|reply
[+] [-] abc_lisper|10 years ago|reply
[+] [-] maelito|10 years ago|reply