Recent submissions

Comment · 8 years ago
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.
Comment · 11 years ago
Is thinking obsolete too?
Comment · 12 years ago
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.
Comment · 12 years ago
I was interested until I noticed it was pay-to-win. Instantly closed the tab.
Comment · 12 years ago
No. I love it. It's so simple. Even if Haskell has pretty nice syntax, I found myself resenting it because I needed to remember operator precedence.
Comment · 12 years ago
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.
Comment · 13 years ago
Yeah, only Lisp is beautiful. ;)
Comment · 13 years ago
Big O is not necessarily about execution time. Also, why is it ridiculous to describe execution time as "time complexity"? From http://en.wikipedia.org/wiki/Analysis_of_algorithms "Usually, the efficiency or running time of an algorithm is stated as a function relating the input length to the number of steps (time complexity) or storage locations (space complexity)."
Comment · 13 years ago
Branching factor 32 is great for lookups, but isn't it slower for modification? At least, one has to create more array cells in total (31 copies in each node), no?
Comment · 13 years ago
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).

Comment · 13 years ago
Of course O(n) is not equal to O(n^2). O(n) is a set, and O(n^2) is a different set.
Comment · 13 years ago
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.
Comment · 13 years ago
That's your biggest concern?
Comment · 13 years ago
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.

Comment · 14 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton