HN user

oskarkv

28 karma
Posts1
Comments40
View on HN

True, but I am convinced that meditation can lead to awakening, which, apparently, involves the cessation of suffering and feeling one with the universe. It's not so far fetched, since our experience is generated by our brains, and similar things can happen on drugs.

It really is readable, to me at least. I just wanted to say that because some people will perhaps read your comment and take it as true, because they too struggle with it at the moment, and then discard Clojure. But I'm just in love with it---yes, the syntax.

For very simple cases there are the threading macros, `->` et al., that you can use like this:

  (-> state 
      (assoc :a val) 
      (update-in [:b :c] f args) 
      (dissoc :d)
      (some-other-fn args))
where :a - :d are keys.

Or you could use monads in much the same way as you would in Haskell; there are libs for that.

Or you could write a new macro (or maybe even function) that does exactly what you want. I did that for a game. It looked like this:

  (call-update-fns game-state hook
    (update-monster-positions)
    (update-monster-ai)
    (let-characters-attack)
    (some-other-stuff))
It would thread the game-state (immutable) through all the functions, and call hook (a function) in between all the functions to send network messages and stuff (to minimize latency), and also collect and return new events that the functions created that I needed to handle (e.g. someone died when the characters attacked). It's almost like the state monad but not quite.

First of all, O(g(n)) is a set. It is the set of functions f(n) such that there exists positive constants n0 and C, and C*g(n) > f(n) when n > n0.

Second, talking about O(g(n)) does not imply that the time complexity being discussed is the worst-case (or any other case) time complexity. One could for example say that the algorithm A's best-case time complexity is in O(n), and it's worst-case time complexity is in O(n^2).

He says he understood the power of Lisp, yet he made a non-Lisp language. :P I don't get people who make non-Lisp languages.

Does Chicken have immutable data structures? How about typeclasses/protocols? How about literal syntax for hash maps, sets, vectors/arrays?

I'm coming from Clojure, and I'm interested in Chicken. I really like the things mentioned above about Clojure and I am just interested in how Chicken compares when it comes to these things.

I don't know what you mean by widespread. But work on it does not seem to be slowing down, and it is a really good language, so I think it will only grow.

There is a lot of stuff in Clojure that can be done in more than one way. I know that Python focuses on "only one way to do it", but Clojure's focus is on simplicity, as defined by Rich Hickey in Simple Made Easy [1], and that is a much better focus. I find that, as Rich says (and I'm paraphrasing), simplicity is by far the most important concern when programming. It dominates all other concerns in terms of importance and payoff. I believe I have become a much better programmer since I learned Clojure and listened to Rich's talks.

[1] http://www.infoq.com/presentations/Simple-Made-Easy

Yeah, I know about it, but it's an additional dependency, right? [org.clojure/core.logic "0.7.5"] Whatever, Clojure is clean and simple is what I wanted to say. :)

Your comment gives the impression that Clojure is a big multiparadigm mess. But it is not. Clojure's design is clean and simple. Clojure is mostly functional. Sure, since it's a Lisp one can kind of incorporate other paradigms with macros. But out of the box Clojure does not do Java-style OOP (except for interop) or Prolog-style logic.

The correct statement about lower bounds is this: "In the worst case, any comparison based sorting algorithm must make Ω(n log(n)) comparisons."

You are making the same mistake that people that have Misconception 1 make. "The algorithm must make <a set of functions> comparisons." is a nonsensical statement.

As far as I have understood, this is just regular memoization. I mean, often in functional languages one just turns a regular function into a memoized version by calling memoize(function). Sometimes that works to create a function that does what your code does, and sometimes it does not. When it does not I think that's a shortcoming of the language/implementation.

If you found this interesting and have not tried Clojure yet, you should really give it a go. Learning Clojure teaches a lot about programming just because it is very well-designed.

I have heard many people complain about the documentation (in fact I've seen you do it before ;)). But I think the documentation is great; concise and informative. I learned more from the docs (the reference) on clojure.org than any book.

From the article: "I was trying to memorize equations..."

That's doing it wrong. I agree with you that math education is probably broken. I imagine that math is very boring if memorizing equations is what you are doing.

I will say that the online documentation IS atrocious and basically impenetrable...

Maybe it's just me, but I find the documentation to be very good. Everything on clojure.org is relevant, clear and concise. I read two books too, but I learned the most from clojure.org.

This is kind of interesting. Where does your thoughts come from? If I asked you to think of a famous person, and say the first person that comes to your mind, what determines whom you will think of? Presumably you were not thinking of a person before I asked. Did you have any choice in what person you started thinking about?

I don't know about 15-30 minutes, but for anyone interested in learning Clojure, I have collected these links that I found interesting:

http://www.youtube.com/watch?v=Aoeav_T1ARU

http://blip.tv/clojure/clojure-for-java-programmers-1-of-2-9...

http://4clojure.com/

http://www.ibm.com/developerworks/podcast/ag/gloverseries-ha...

http://www.infoq.com/presentations/Value-Identity-State-Rich...

http://clojure.blip.tv/file/4824610/

http://clojure.blip.tv/file/4457042/

http://vimeo.com/11236603

http://www.infoq.com/presentations/Clojure-in-the-Field

Visit them roughly in order.

As for books, there are a few good ones, but I acutally recommend the documentation on clojure.org more than any book. It's clear and compact.