Live data from Hacker News

Getting Started With Clojure

jrheard.tumblr.com

91–100 of 113 posts

Re: Getting Started With Clojure

#91
post #37

Earlier quoted context omitted.

So Clojure has over (say) Ruby the feature that you don't have to install it. Yet you do have to install a JVM... How is installing a JVM better than installing any other interpreter or runtime?

"How is installing a JVM better than installing any other interpreter or runtime?" Maybe, just maybe, the fact that Clojure isn't exactly the only program on earth running on the JVM and that, hence, there's a probability p far from zero that the JVM is already installed on your system / on your users' systems!?

There's a good chance that a Perl interpreter is installed on any Linux system, but this is really an incredibly trivial reason to prefer a language. If you can't use (say) a ruby installer you are going to have even bigger problems building almost any kind of software.

Re: Getting Started With Clojure

#92
post #88
post #71

Earlier quoted context omitted.

I'd like to contrast this: if your application is heavily dependent on state, especially state which is shared between threads, Clojure offers a concise, safe, and uniform way to understand and organize state transformations--at the cost of performance. Where fast mutability is required, it's easy to drop down to explicit locks, atomics, java.util.concurrent collections, et al. I find the majority of my time in writi…

At ILC 2009, Guy Steele asked Rich Hickey how Clojure's STM interacted with I/O. To which, Rich replied that it doesn't. No further discussion continued on the subject. I have found that this rarely enters discussions regarding Clojure, although the STM is frequently lauded. GHC's STM also does not work with the IOMonad, which is clear because of the types, and is articulated in books such as such as Real World Haske…

That's odd, that seems a little inaccurate to me. Clojure's agents are useful for encapsulating I/O-related resources, and are integrated with the STM system. Per http://clojure.org/agents -

    Agents are integrated with the STM - any dispatches made in a transaction
    are held until it commits, and are discarded if it is retried or aborted.

Re: Getting Started With Clojure

#93
post #55

Earlier quoted context omitted.

From the Lips's perspective it is a contradiction. Something is either a function or a constant. The logic is that this object could be called as a function and at the same time always evaluated to itself? That means whenever you call it you always getting it back - this is behavior of a constant. But if you could call it with an argument, you will get back some value, different from whatever it is? As long as maps a…

> That means whenever you call it you always getting it back - this is behavior of a constant. No! You're confusing functions-as-callable-things and functions-as-values. The phrase "a constant" does not generally imply anything about a thing's behavior when called . It just means something whose value will never change. A self-evaluating constant is a constant that circularly evaluates to itself — nothing else can ha…

Good explanation!

Evaluation is what happens when you give something as a parameter. Calling is what happens when you do "(f ...)".

Just a little concrete example:

Welcome to Racket v5.3.1. > 'foo 'foo > ('foo) application: not a procedure; expected a procedure that can be applied to arguments given: 'foo arguments...: [none] context...: /usr/lib/racket/collects/racket/private/misc.rkt:87:7

Re: Getting Started With Clojure

#94
post #53

I have been thinking about getting into Clojure, but time is precious. It doesn't seem like there are that many jobs out there, but I could be wrong. For those of you in the industry, why would I want to use Clojure? What would be a good project to try it on? A Web app? Why is it worth learning it?

This post is specially relevant for me, since last weekend I've decided to take a quick look at Clojure, as one of my personal goals this year is to get acquainted with a Lisp dialect. From my _very_ short experience (I've started coding a simple game), here are my two cents: - If your application is heavily dependent on state, which changes continuously and must be maintained during most of the execution time - like…

Actually, in my experience the practises in the high-end AAA game industry are now much closer to FP than the rest of the industry. The current-gen consoles have lots of really weak threads, and to get any decent performance you have to use a lot of them. So, modern games do things like double-buffer the entire world state to allow efficient multithreading.

Of course, everyone there is doing FP in C++.

Re: Getting Started With Clojure

#95
I'm interested in learning LISP. How good a choice is learning Clojure as a way of achieving this?

I've read a page[1] listing differences between Clojure and other LISPs, but I'm not sure that I fully understand the implications of these differences.

[1] http://clojure.org/lisps

Re: Getting Started With Clojure

#96
post #43

Earlier quoted context omitted.

I wanted to get Clojure on my secondary machine to do a little light fiddling, but as it turns out, Windows doesn't include wget or curl, and lein.bat requires those. So I have to download something that requires me to download something so I can download something that will let me install the thing I wanted in the first place. I think it could be a bit easier.

It certainly could be better, but none of the maintainers know Windows, and no Windows users have contributed improvements.

I am using Windows more these days, because of work. I will start documenting what I have done to make Clojure and leiningen work properly, and see what can be contributed.

Re: Getting Started With Clojure

#97
post #55

Earlier quoted context omitted.

From the Lips's perspective it is a contradiction. Something is either a function or a constant. The logic is that this object could be called as a function and at the same time always evaluated to itself? That means whenever you call it you always getting it back - this is behavior of a constant. But if you could call it with an argument, you will get back some value, different from whatever it is? As long as maps a…

> That means whenever you call it you always getting it back - this is behavior of a constant. No! You're confusing functions-as-callable-things and functions-as-values. The phrase "a constant" does not generally imply anything about a thing's behavior when called . It just means something whose value will never change. A self-evaluating constant is a constant that circularly evaluates to itself — nothing else can ha…

@baar: FYI, you appear to be hellbanned (your comments are being automatically killed as soon as you post them). New accounts are particularly susceptible to this, as it seems like the auto-ban algorithm kicks in when you have low karma and get too many downvotes in a short time, or something like that. You should be OK if you make a new account and avoid making very harsh comments so you don't draw downvotes.

Re: Getting Started With Clojure

#98
post #22

I knew about clojars.org, but I hadn't known about http://www.clojure-toolbox.com/ . Very nice! I also recommend the Value of Values video presentation: http://www.infoq.com/presentations/Value-Values . It will help you internalize Clojure's approach to data. I really wish I could remember why I didn't experience nearly as much pain starting out as the author, but I'm glad that he took the trouble to put this togethe…

Off topic perhaps, but is Rich Hickey's wisdom only summarized in talks, or has he written some of this down? I see a number of glowing reviews of videos like this. While I don't want to miss out, I would personally much rather consume this info in writing. The one I did bite the bullet on and watch in full was his talk on “hammock-driven development”. I liked it, but couldn't help feeling it would have made a very n…

The Unofficial Guide to Rich Hickey's Brain http://www.flyingmachinestudios.com/programming/the-unoffici...

Re: Getting Started With Clojure

#100
post #62

Earlier quoted context omitted.

What do your superiors think about implementing new, small projects in Clojure? When you say "has a huge amount of useful libraries" but then say that Python is "batteries included", which libraries in Clojure are particularly useful? Which ones did you wish it had?

If you don't find a Clojure library meeting your needs, you can always find a Java library for that purpose and "wrap the crap". http://news.ycombinator.com/item?id=1883043

To me, this is the smartest part of using Clojure in your projects. If you're a company with an enormous Java stack, it's trivial to add things like Clojure or Scala and use them as scripting languages. Or break out a library and rewrite it using one of the two, if that problem would be better solved more functionally.

Basically it makes it easy to convert projects without tearing down your infrastructure, ie, easy to convince your boss.

Post reply on HN