News for hackers. Stuff that matters.
Re:Idiomatic Clojure with LightTable by dopamean on Monday November 18, 2013 @10:37AM (#6754762)
I've been wanting to learn Clojure and recently bought the book Clojure Programming (not to be confused with Programming Clojure) and I'm curious to know if others believe it is a good idea for a Clojure novice such as myself (lisp and JVM novice too) to use kibit while learning. Any advice would be greatly appreciated. Thanks.
Re:Idiomatic Clojure with LightTable by dandrews on Monday November 18, 2013 @11:33AM (#6755091)
You're new to Lisp and JVM? (Perhaps new even to Emacs?) The activation energy required to get going in Clojure can be a bit daunting. Cool tool that it may be, I think that kibit should wait until you can drive around with some confidence. Premature optimization and all that, y'know.
Re:Idiomatic Clojure with LightTable by dopamean on Monday November 18, 2013 @11:59AM (#6755282)
Yup, new to Lisp and JVM. All of my experience, brief as it has been, is in Ruby. I've only taken a cursory glance at the book I purchased and frankly I think I'll be ok picking up Clojure. It just may require a lot of focus. Is Emacs the typical editor Clojuristas use? I use vim though I have recently switched to Sublime.
Re:Idiomatic Clojure with LightTable by cliftonk on Monday November 18, 2013 @12:19PM (#6755425)
I use emacs for anything with S-expressions and vim for everything else, but you should be careful with information overload. It's very easy to get started with LightTable if you want to play with Clojure, so I'd recommend that approach to work through book examples.

If you're new to Lisp, I'd recommend working through Land of Lisp [1], and pg's On Lisp [2] in order. They're both Common Lisp books, but they will introduce you to and expand your mind on (respectively) what's possible with all the power Lisp gives you. Virtually everything you learn in those books will be very nice tools to have in your toolbox as a Clojure dev.

As for the best starting Clojure book, Clojure Programming [3] is excellent. It has great OOP -> FP examples, is fairly extensive and well-written.

[1] http://landoflisp.com [2] http://www.paulgraham.com/onlisptext.html [3] http://www.clojurebook.com

Re:Idiomatic Clojure with LightTable by trevorhartman on Monday November 18, 2013 @12:38PM (#6755578)
https://github.com/tpope/vim-fireplace is where it's at for vim/clojure tools.
Re:Idiomatic Clojure with LightTable by cjo on Monday November 18, 2013 @12:22PM (#6755453)
I've heard good things about using emacs-live (https://github.com/overtone/emacs-live) to get you up and running quickly.
Re:Idiomatic Clojure with LightTable by cliftonk on Monday November 18, 2013 @01:19PM (#6755823)
+1 for emacs live
Re:Idiomatic Clojure with LightTable by leephillips on Monday November 18, 2013 @12:09PM (#6755354)
Vim can work very well with Clojure (I use it). Look into ScreenSend, which lets you send code from the editor to a repl. You can use it with Python as well, and anything with interactive evaluation. You might also want to install paredit, which keeps your parentheses sorted out for you.
Re:Idiomatic Clojure with LightTable by jballanc on Monday November 18, 2013 @12:28PM (#6755488)
Correction, you must install paredit (and spend half a day familiarizing yourself with how it works). It'll make your learning experience 10x easier.

As for Emacs vs Vim, I also use Vim for Clojure development. There's definitely a bias toward Emacs in the community, but that doesn't mean that you have to go with Emacs. In fact, there are now useful plugins/packages to work with Clojure in Vim, Sublime, IntelliJ, Eclipse, as well as Emacs. There's even two editors written in Clojure itself: Clooj (https://github.com/arthuredelstein/clooj) and the afore-linked LightTable.

Re:Idiomatic Clojure with LightTable by edoloughlin on Monday November 18, 2013 @06:50PM (#6758181)
Correction, you must install paredit

Or the newer Smartparens: https://github.com/Fuco1/smartparens/wiki

Re:Idiomatic Clojure with LightTable by michaelsbradley on Monday November 18, 2013 @06:49PM (#6758174)
(> smartparens paredit) ;; true

https://github.com/Fuco1/smartparens

Re:Idiomatic Clojure with LightTable by wuschel on Monday November 18, 2013 @10:45AM (#6754806)
(Confession: I am a novice to clojure/scheme/JVM myself.)

I admit that I have not tried kibit yet. However, LightTable/REPL is a great tool for this endeavour. If only clojure could have an error tracking report that would be comparable to the wonderful implementation that can be found with the python IDLE.. but I guess that is too much to ask?

Re:Idiomatic Clojure with LightTable by mrgoldenbrown on Monday November 18, 2013 @10:49AM (#6754825)
Can you elaborate on what you mean by "error tracking report" in IDLE? Either I'm missing something cool about IDLE or I am totally misunderstanding. Thanks!
Re:Idiomatic Clojure with LightTable by wuschel on Monday November 18, 2013 @10:54AM (#6754852)
Sorry, what I meant was the TraceBack. It helped a great deal when learning programming and hunt those nasty bugs:

  Traceback (most recent call last):
    File "C:/Users/wuschel/Desktop/error-track.py", line 3,   in <module>
      newstrin = teststrin + 3
  TypeError: cannot concatenate 'str' and 'int' objects
In clojure, you get those error reports in java lingo - I don't know how fast you can get use to that kind of error messages when you do not know Java. Now, this one is obvious, but it just should serve as an example:

  clojure.lang.Compiler$CompilerException: 
  java.lang.RuntimeException: clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: b in this context, compiling:(null:4:1)
Re:Idiomatic Clojure with LightTable by mrgoldenbrown on Monday November 18, 2013 @11:02AM (#6754900)
OK, this makes sense. I'm slightly disappointed though, I was hoping to learn a secret new python feature :)
Re:Idiomatic Clojure with LightTable by mseebach on Monday November 18, 2013 @10:41AM (#6754785)
Kibit looks neat, I haven't tried it. I think the generally applicable advice is to get comfortable with the core first, then add tools and libraries at the speed you're comfortable with, making sure that you understand what each component does.
Re:Idiomatic Clojure with LightTable by cgag on Monday November 18, 2013 @05:01PM (#6757424)
Running `lein kibit` is super low effort once you've got lein set up, and even having used clojure for years it still reminds of features of clojure.core that I forgot pretty regularly. I think as a noob it would really help you in learning the core lib.
Re:Idiomatic Clojure with LightTable by sandbags on Monday November 18, 2013 @11:18AM (#6754991)
I cannot see any problem with using kibit.

Quite often my experience when learning a new language is "Am I doing this right? Or even close to right?"

If kibit can turn your code into idiomatic Clojure then you have a tool for exploring your solutions and how close they look to Clojure as it might be written by a native.

It can also prompt questions "Why do it this way rather than this way?" which could be a good learning opportunity.

I see no harm, only benefit.

Matt

Re:Idiomatic Clojure with LightTable by cjo on Monday November 18, 2013 @12:07PM (#6755336)
I think it would only be good if its used as a learning tool and not a code-writing tool, compare:

write the best code you can -> run kibit -> spend an hour reading the docs and every blog post you can find about a feature you didn't know about -> repeat

write the best code you can -> run kibit -> show off your awesome code, you're a rockstar!

Re:Idiomatic Clojure with LightTable by sandbags on Monday November 18, 2013 @12:17PM (#6755406)
I agree with you although I think that's an unlikely scenario.

kibit, so far as I understand it, is a pattern matching solution that can replace one structure with another - more idiomatic - structure. It doesn't add anything and, hence, can't actually solve your problems for you.

Re:Idiomatic Clojure with LightTable by Anderkent on Monday November 18, 2013 @01:26PM (#6755884)
Well, the problem comes up when it gives you proposals that are not equivalent, because it doesn't understand macros and/or local scope :)
Re:Idiomatic Clojure with LightTable by Edmond on Monday November 18, 2013 @11:50AM (#6755214)
You could try our product (www.crudzilla.com)

here's a short video demoing coding in clojure and other jvm languages:

http://www.youtube.com/watch?v=AqeOS2hqtMg

Re:Idiomatic Clojure with LightTable by miloshadzic on Monday November 18, 2013 @07:24PM (#6758336)
It's easy to get carried away with everything. My advice: start with an editor you know and use everything vanilla. You'll appreciate better tools more once you spend some time and get a feel for the pain points.