5 ms·
Ask HN: Getting started with Clojure
Hi all,
I recently decided to start learning Lisp, and after some very unscientific research decided on Clojure. I'd like to know about some good resources to start learning clojure. I come from a mostly C background.
Also, I don't believe in starting small and then gradually writing more complex programs, I usually just do a small Hello World and then jump directly into a decently complex program, and I'd like to do the same with clojure. Is this a good approach to clojure?
Ideally, I'd like to get started with a small GUI program.
Regards,
chaosprophet
Edit: I don't know anything about functional programming either.
- darkxanthos 17y agoI want to get started in Clojure too. Rich Hickey's talks on InfoQ have been making me feel kind of funny... like when we used to climb the ropes in gym class. But seriously, yeah I'd love to find a project to play with its concurrency features and learn some gui as well.
- gtani 17y agoI haven't done any GUI's in clojure, but i think swing is best doc'd, stuart Sierra series: http://stuartsierra.com/2010/01/03/doto-swing-with-clojure?0.004707886526261973 http://stuartsierra.com/2010/01/03/doto-swing-with-clojure?0... http://stuartsierra.com/2010/01/02/first-steps-with-clojure-swing http://stuartsierra.com/2010/01/02/first-steps-with-clojure-... -------------------- or SWT: http://berlinbrowndev.blogspot.com/2009/02/doing-it-wrong-fun-with-clojure.html http://berlinbrowndev.blogspot.com/2009/02/doing-it-wrong-fu... http://www.li-am.com/2009/08/button-in-eclipse-swt-clojure.html http://www.li-am.com/2009/08/button-in-eclipse-swt-clojure.h... http://www.li-am.com/2009/08/swt-is-alive-from-clojure.html http://www.li-am.com/2009/08/swt-is-alive-from-clojure.html http://www.li-am.com/2009/08/jface-examples-in-clojure.html http://www.li-am.com/2009/08/jface-examples-in-clojure.html ---------------- there's also bits on Qt and JWT, search for them
- gtani 17y agoIt's kinda like the firehose drink, the language and compiler are changing rapidly, but I think what's described in Stuart Halloway's (excellent) book is still applicable, except for some very small number of bugfixes and breaking changes in 1.1 and 1.2. The next release of Fogus/Houser's draft "Joy of Clojure" book should be butt-kicking, don't know when that's scheduled tho. Also, installing swank, slime and paredit, and getting one/more of leiningen/ant/maven to work seem to consume a lot of bandwidth (this might be one of the times that the MS windows install is more straightforward). just saw this for Debian: http://measuringmeasures.blogspot.com/2010/01/my-new-clojure-emacs-setup.html http://measuringmeasures.blogspot.com/2010/01/my-new-clojure... the IRC and google group are very friendly, ask questions!
- chaosprophet 17y agoThanks, I was thinking of using Qt, but I'll look into the others too.
- dkarl 17y agoIf you want to proceed quickly from Hello World to a complex application, I suggest looking at Eclipse RCP, which uses SWT. Whether it is suitable will depend on what kind of app you want to build. Here's a list (with screenshots) of open-source apps that use Eclipse RCP: http://www.eclipse.org/community/rcpos.php http://www.eclipse.org/community/rcpos.php
- Zak 17y agoIt's a big help if you have a baseline ability to read Java, as it's likely the example code for libraries you'll want to use is in Java. You don't need to be able to create a baroque class hierarchy yourself as long as you can navigate one well enough to figure out the library calls you need to use. Clojure is a fairly gentile introduction to functional programming, I think. You can do imperative-style things with the reference types, so you don't need to completely learn how to structure the logic of a program.
- chaosprophet 17y agoI'm fairly decent with Java, so I guess working with java libraries shouldn't be a problem.
- francoisdevlin 17y agoI strongly recommend Stuart Halloway's book, Programming Clojure. http://pragprog.com/titles/shcloj/programming-clojure http://pragprog.com/titles/shcloj/programming-clojure Mark Volkmann also wrote a pretty good article: http://java.ociweb.com/mark/clojure/article.html http://java.ociweb.com/mark/clojure/article.html Stop by the Google group with ANY questions. No question is too silly. We're all dying to help. http://groups.google.com/group/clojure http://groups.google.com/group/clojure Once you get the basics down, and you don't mind some shameless self promotion... http://vimeo.com/channels/fulldisclojure http://vimeo.com/channels/fulldisclojure SFD
- Zak 17y agoDon't forget #clojure on freenode. I've lost count of the number of stupid questions I've had answered there. Rich Hickey is active on the channel and may even be the one to answer your questions.
- chaosprophet 17y agoThanks, I've already put out an order for Programming Clojure. I'm going through the Mark Volkman article now.
- gtani 17y agoread about STM http://www.tbray.org/ongoing/What/Technology/Concurrency/ http://www.tbray.org/ongoing/What/Technology/Concurrency/ http://www.sauria.com/blog/2009/10/05/the-cambrian-period-of-concurrency/ http://www.sauria.com/blog/2009/10/05/the-cambrian-period-of... http://groups.google.com/group/clojure/browse_thread/thread/5c7a962cc72c1fe7?hl=en http://groups.google.com/group/clojure/browse_thread/thread/... http://blogs.azulsystems.com/cliff/2008/09/jvm-language-su.html http://blogs.azulsystems.com/cliff/2008/09/jvm-language-su.h... http://wiki.jvmlangsummit.com/pdf/36_Click_fastbcs.pdf http://wiki.jvmlangsummit.com/pdf/36_Click_fastbcs.pdf
- anonjon 17y agoThat's what I did to learn Clojure. The only problem with starting off doing GUI is that you will be in javadoc hell learning swing (or whatever) at the same time as Clojure. But it is nice having GUI essentially baked into the language.
- jacquesm 17y agoI found this comment to be most helpful: http://news.ycombinator.com/item?id=1033503 http://news.ycombinator.com/item?id=1033503
- gtani 17y agothat's not a comment that's the Iliad and Odyssey of cloj tutorials
- hga 17y agoMore of a meta-tutorial, but thanks! I've never been compared to Homer before.... I just reviewed it and it's still current, there are no new video venues that I know of and the next Clojure books are still in progress.
- jamesbritt 17y ago"I've never been compared to Homer before...." I have, but it involved the word "Doh!" :) Thanks for the extra-informative post; it makes poking around Clojure less daunting.
- chaosprophet 17y agoWow, that's really thorough. Thanks for digging it up, I didn't find it in my own search of HN.
- mark_l_watson 17y agoSetting up IntelliJ (version 9, either free open soirce version or commercial version)with the Clojure plugin was a good start for me. I bought Stuart's book (physical book) and the other two Closure books as work in progress PDFs - good references and a help to write idiomatic Clojure code. BTW, IntelliJ free version also works well with the Scala plugin, so you can mix Java+Clojure+Scala in one project. With the commercial version, you can add JRuby to the mix.
- jacquesm 17y agoWhy on earth would you want to build a website using four different languages? Isn't the fact that you always get HTML+CSS and JavaScript tossed in for free enough of a nightmare?
- mark_l_watson 17y agoA fair question: I am writing a utility in Java, but I wanted to supply idiomatic wrappers for JRuby, Scala, and Clojure.