Hacker News new | past | comments | ask | show | jobs | submit login
Clojure N00b Tips from Tim Bray (tbray.org)
56 points by gthank on Nov 3, 2009 | hide | past | favorite | 13 comments



What I would really like to see is an intro to Clojure that assumes the user doesn't have a background in Java at all. That's been by far the toughest part of using Clojure for me - dealing with things like managing CLASSPATHs and the like.


YES. Dealing with CLASSPATH wonkery right now. I just want to get back to coding. :(


Altho I have to give props the it #clojure channel on Freenode for being awesome.


I had the same headache, and finally spent an hour reading java docs and experimenting with the classpath. It's straightforward once you do that. Learning maven on the other hand ... :/


I would advise staying away from both Ant and Maven. Use Rake or some other scripting based build system and cut out the XML middleman (this from a long-time Java coder who's fed up with the impedence mismatch of 'I want to do X, but XML lets me do Y, and I don't have time to write my own Ant task to do it').

But, if you must, use Ant and forget about Maven - way more complex than it needs to be. And, again, if dependency management is a must, look at Ivy.


Yeah Maven has been a tough road to say the least. Some time soon I want to just sit down and go through some of the maven tutorials/docs out there and lock in on getting comfortable with it, since it seems so popular.


Throw Maven the hell away - ant is more than powerful enough for your needs and really simple to extend.


That is an interesting oversight, but it properly steams from the notion that most people would get involved with Clojure as a way to escape from Java.

Anyway Sun has some not to horrible articles that explains Java and you might be able to find information there.

In addition, the stackoverflow.com is a great way to ask these kinds of questions since they have a lot of former and current Java developers.


From the mailing list, my impression on the most frequently asked/discussed topics:

* Laziness: Does something hold onto the head of a list or does it drop it. Memory characteristics of the same. Unexpected memory usage.

* Compilation: When and in what way is clojure compiled. How to do AOT. How to produce named Java classes. How to create executable JARs.

* Java interop: Given a java snippet, what is the closest idiomatic clojure. What library is used to do foo.

* Performance: How can a snippet of code be made to run in less time. Why should or shouldn't a snippet of clojure be faster. What is the typical speed relationship between a piece of Java code and a piece of clojure code. How to type-hint a snippet of code. What can/cannot be type-hinted. What are and how best to use transients.

I feel like those topics account for a large percent of the traffic on the list. I'm certainly leaving things out. All of the above have been dealt with at one time or another on the list.


"... Unlike Ruby, Clojure doesn’t come with a precooked readline-equipped REPL, but you can get a primitive one going in a simple shell script ..."

Big oversight?


There are readline wrappers such as rlwrap ( http://www.digipedia.pl/man/doc/view/rlwrap.1.html ), which may be handy for other stuff.

Bray does add "Don’t do that though, get yourself some IDE help."


No, not really the primitive one is quite good and for anything more advanced you will need Emacs anyway.


"... No, not really the primitive one is quite good ..."

Does make me wonder why a negative comment about the readline was included if this is the case?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: