This is a great project! 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 darkn…
Show HN: Clojure by Example
21–30 of 37 posts
Re: Show HN: Clojure by Example
#22Re: Show HN: Clojure by Example
#23The 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..."
Re: Show HN: Clojure by Example
#24Clojure 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'. Unfortuna…
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.
Re: Show HN: Clojure by Example
#25Clojure 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'. Unfortuna…
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 quit…
That said, "add more type hints" hasn't generally been my experience of Clojure. If anything, it tends to be an indication that you've already gone a bit far down the path of "doing things the Java way".
Re: Show HN: Clojure by Example
#26Clojure 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'. Unfortuna…
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.
Re: Show HN: Clojure by Example
#27I found Slate is very easy to use and customize!!
Re: Show HN: Clojure by Example
#28Clojure 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'. Unfortuna…
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 quit…
Is the problem that you struggle with how to solve problems in a functional style? I can imagine that Clojure might be a tough place to start for learning FP, even though you don't have to worry about a type system such as in an FP language like Haskell. What really helped me understand functional programming (in the lispy sense, not the Haskell sense) was the free book "How to Design Programs" http://www.htdp.org/ This book taught me, for instance, how to break down problems into small blocks that use recursion, and how to compose those blocks together.
There's also a second edition that seems to be significantly more streamlined (which is probably more appropriate, given your existing experience with programming), but I haven't used it: http://www.ccs.neu.edu/home/matthias/HtDP2e/
In the end, if you can make things that solve problems, that's what really matters. :) Consider a language like Clojure as another tool. There's no requirement that you use it.
Re: Show HN: Clojure by Example
#29Clojure 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'. Unfortuna…
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…
This is what I'm talking about. Performance-wise, Clojure is all about scaling, not absolute performance. From my point of view (lots of low-level, embedded, real-time,DSP,C,C++, etc). I personally get appalled at the performance that is left on the table when using idiomatic Clojure (and even Java)... (Try doing an FFT in pure-idiomatic Clojure and compare to even a naive C implementation running on a lowly PIC32 or ARM...) it would be interesting what level of microcontroller your i7 is now reduced to.
I love the ideas behind Clojure and scalability is great... but when you're talking about scaling an application, make sure you're not throwing away silly amounts of performance before you scale it horizontally.
Re: Show HN: Clojure by Example
#30Earlier quoted context omitted.
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 quit…
https://github.com/pixie-lang/pixie could be worth a look. That said, "add more type hints" hasn't generally been my experience of Clojure. If anything, it tends to be an indication that you've already gone a bit far down the path of "doing things the Java way".
Pixie does look promising and is more my type of thing (coming from a low-level background) but I haven't managed to have time to look at it properly yet tho.