News for hackers. Stuff that matters.

oskarkv

Re:Mindfulness may have been over-hyped on Tuesday May 08, 2018 @08:34PM (#17026570)
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.
Re:Mathematics for Computer Science on Sunday April 05, 2015 @12:09AM (#9323092)
Is thinking obsolete too?
Re:Amazon is hiring Clojure devs on Thursday November 27, 2014 @12:26PM (#8668128)
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.
Re:Show HN: HTML5 MMORPG – Node.js on Friday July 04, 2014 @02:48AM (#7987650)
I was interested until I noticed it was pay-to-win. Instantly closed the tab.
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.
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.
Re:Free screencasts to learn Go on Monday January 13, 2014 @09:45AM (#7050791)
Yeah, only Lisp is beautiful. ;)
Re:Plain English explanation of Big O on Monday December 09, 2013 @09:40AM (#6874462)
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)."
Re:Understanding Clojure's Persistent Vectors, Part 1 on Thursday September 26, 2013 @01:42AM (#6449121)
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?
Re:Big-O notation explained by a self-taught programmer on Saturday July 27, 2013 @04:04AM (#6112192)
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).

Re:Big-O notation explained by a self-taught programmer on Saturday July 27, 2013 @03:41AM (#6112151)
Of course O(n) is not equal to O(n^2). O(n) is a set, and O(n^2) is a different set.
Re:How Emacs changed my life on Wednesday July 24, 2013 @01:50PM (#6097770)
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.
Re:Why they keep developing Java/C# on Wednesday June 26, 2013 @11:14AM (#5946560)
That's your biggest concern?
Re:Behind the Scenes with Chicken Scheme on Friday May 03, 2013 @05:55AM (#5649538)
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.

Re:List Comprehensions in Eight Lines of Clojure on Wednesday January 02, 2013 @03:10AM (#4995783)
`for` is a macro, not a special form. Special forms are these: http://clojure.org/special_forms
Re:Clojure 1.5.0 RC 1 released on Saturday December 22, 2012 @09:05PM (#4958286)
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.
Re:Clojure 1.5.0 RC 1 released on Saturday December 22, 2012 @09:00PM (#4958273)
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

Re:Extremist Programming on Wednesday November 21, 2012 @04:05PM (#4816310)
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. :)
Re:Extremist Programming on Wednesday November 21, 2012 @02:17PM (#4815799)
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.
Re:Big-O Misconceptions on Monday October 15, 2012 @08:32PM (#4657830)
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.

Re:The Racket Blog: Dynamic Programming versus Memoization on Sunday August 26, 2012 @11:21AM (#4435256)
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.
Re:Rich Hickey: The Value of Values on Tuesday August 14, 2012 @07:33PM (#4383622)
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.

Ask HN: Examples of Complecting

I recently watched Rich Hickey's excellent talk Simple Made Easy http://www.infoq.com/presentations/Simple-Made-Easy/. After watching it I have noticed that a lot of tips I've heard and problems I've encountered boils down to what Rich was talking about; complecting.For example this http://unlikekinds.com/post/17192015158 blog post argues that, when programming games, one shouldn't use...

( Read More... | no comments | on HN )
Re:The Caves of Clojure on Sunday July 08, 2012 @08:15AM (#4214416)
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.
Re:Math For Programmers on Tuesday April 03, 2012 @10:26AM (#3793030)
I think this book is very good. Lots of exercises and very clear. http://www.amazon.com/Discrete-Mathematics-Norman-L-Biggs/dp...
Re:Vim-powerline: The ultimate vim statusline utility on Thursday January 12, 2012 @11:42PM (#3459231)
A couple of questions about Vundle.

What about plugins that are not in a git repo (but a hg repo)?

What if I don't want the lastest version of a plugin?

Re:Why Science Majors Change Their Minds on Wednesday November 16, 2011 @12:17AM (#3241919)
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.

Re:Initial Thoughts on Clojure on Saturday August 13, 2011 @07:07PM (#2882232)
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.

Re:Accidental Genius: How To Think on Monday July 25, 2011 @01:41AM (#2801495)
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?

Older »