Live data from Hacker News

Why I am excited about Clojure

blog.txus.io

81–90 of 173 posts

Re: Why I am excited about Clojure

#81
post #71

> With Clojure your editor (be it Vim, Emacs, Light Table...) is permanently connected to a live REPL. You continually develop, test and modify functions with subsecond feedback. Continuously. Can anyone explain or point me in a direction where I can learn how the above functionality is actually used and useful? I keep hearing about live-editing/hot-reloading, and in theory I believe it must be very useful, but I can…

It's a side effect of decoupling. If you don't need to pass the world in to a function, then it is much easier to poke at.

I played with Clojure making a simple pong game, and used this to work on collision detection. I worked on a function called rect-intersects that took in two rectangles. It was much faster to work on than if I'd booted up the game each time.

Re: Why I am excited about Clojure

#82
post #36

The reason I end up with Python, CoffeeScript or Ruby and not a Lisp is the prefix notation and the parentheses. The parentheses can decrease readability and the prefix math expressions can make the order in which you think up a solution awkward. http://sourceforge.net/p/readable/wiki/Problem/ http://cs.brown.edu/~sk/Publications/Papers/Published/mfk-va...

I don't know about Clojure, but you can usually use an infix reader in common lisp to get around that.

What's more, because one can macroexpand on the fly, you can actually see the code that it transforms into.

Re: Why I am excited about Clojure

#83
post #2

What is it about Clojure that Rubyists love? I am a Rubyist who is new to Clojure (I love it) and I cant explain it myself. Clojure was suggested to me by several other Rubyists. I find myself suggesting it to other Rubyists as well....

I also went Ruby -> Clojure.

Ruby appealed to me because of its simplicity and conciseness, but after a couple years it turned out to actually be rather complex.

I found the simplicity and conciseness I was looking for when I was randomly reading some Clojure code a couple years ago in the speclj sample docs (http://speclj.com/tutorial/step7) of all things.

Re: Why I am excited about Clojure

#84
post #55

I'm a C# guy at work, I also do some front-end in javascript (with angularjs sometimes). For side-projects I like to use node.js. I want to learn another language, and I've been wondering wether I should go with Clojure or C++ ? My dilenma is "Do I want to learn more about programming style running on VMs (functional) or do I want to dive into barebone high performance code ?" I've done C and Java at university, but…

I'm a C# guy at work too. I can't say I've touched much C++ outside of college also a while ago, but I've been studying functional programming for a while and really enjoying the new concepts it teaches. It can be a bit humbling at times though.

I got some good perspective with https://www.coursera.org/course/proglang and you could do worse than taking grossman's excellent course. It helps to have some structure and a schedule when starting imho.

I will admit at times I wish I had more chops (closer to the metal i.e. C or C++), but I think I was eventually just more interested in new ways to think about programming, and I'm not sure I'd get the same pleasure out of digging back into C++.

Obviously, if you know something more about your intended use case (i.e. you want to program games), you can make a more informed decision.

Re: Why I am excited about Clojure

#85
post #40

Earlier quoted context omitted.

I'll try to dispel some of the concerns about Clojure. 1) Stacktraces in JVM may be ugly, but the amount of insight into runtime issues that the JVM offers you is generally way higher than in runtimes like cpython or MRI. 2) Clojure gives you a rather elegant way to work with the different JVM number types as it offers literals for those. I think Java Longs (the integer default) should be long enough as it's a 64 bit…

One thing I've noticed is that the JVM startup time is actually pretty small. What's slow is waiting for Clojure to bootstrap itself.

Yep. A JVM doesn't take more than a about 100ms to start up. But Clojure takes a long time, and Leiningen is slow as hell.

Re: Why I am excited about Clojure

#86
post #25
post #14

That last feature is certainly one of my favorite parts about Clojure. It's one of my favorite parts about Lisps in general actually, but Clojure has a very good handle on it. Having to compile a program before seeing if the changes you made work can be a nuisance. Interpreted programs are slightly better, but being able to make micro-changes to a running instance of a program and seeing in real-time how it affects t…

What I find really surprising is that other languages that have pretty decent REPL support have not embraced it so fully as Lisps have. Connecting to the live[0] instance a Rails or Django app, examining its internal state and making updates that don't involve more or less restarting the app is unusual at best. Ruby and Python borrow a lot from Lisp, including the REPL, but some of the most popular applications of th…

You might like Flask. It has an interactive REPL on debug screens.

Re: Why I am excited about Clojure

#87
post #76
post #70

Earlier quoted context omitted.

Wow. I came to the exact opposite conclusion you have. Changing requirements is really where Haskell shines. The ability to make a change in the types and have the compiler tell you everything that needs to be updated is an enormous aid to refactoring. As for exploratory programming? Haskell has powerful tools to do that as well. GHCI, type inference and typed holes[0] work extremely well for exploration of what's po…

I agree, though one has to compare apples and apples. experienced programmer vs inexperienced programmer is not fair. Of course if one is unfamiliar with how to build a flexible type safe systems, (newbies), there could be these sorts of issues. But for experienced programmers, not really.

though one has to compare apples and apples. experienced programmer vs inexperienced programmer is not fair.

Oh, definitely. I just feel that far too many people focus on programming languages that are good for beginners without really thinking about them from an experienced programmer's perspective. What may be good for a beginner can often be terrible for an expert. What may be hard to understand for a beginner can be extremely powerful and simplifying for an expert.

I think the question people should ask themselves is: "Do I want to stay a beginner forever? If not, why am I using tools that are designed for beginners?"

Re: Why I am excited about Clojure

#88
post #25

Earlier quoted context omitted.

What I find really surprising is that other languages that have pretty decent REPL support have not embraced it so fully as Lisps have. Connecting to the live[0] instance a Rails or Django app, examining its internal state and making updates that don't involve more or less restarting the app is unusual at best. Ruby and Python borrow a lot from Lisp, including the REPL, but some of the most popular applications of th…

You might like Flask. It has an interactive REPL on debug screens.

I have used Flask. I do like it.

Re: Why I am excited about Clojure

#89
post #67

Man. I know Lispers hate hearing about it, but I was so on board with this until the sample ClojureScript code and all the parens. I just… don't wanna write code like that.

I felt the same way as you until I actually tried Clojure. In a few hours all my rejection of the parens dissapeared because I finally understood. Try solving a small problem in Clojure (a code Kata, or a problem from Project Euler) and you'll see those aprehensions against the parens will go away. Nowadays I'm having trouble to accept the syntax of other languages, eg. Scala :-)

[deleted]

Re: Why I am excited about Clojure

#90
post #40

Earlier quoted context omitted.

I'll try to dispel some of the concerns about Clojure. 1) Stacktraces in JVM may be ugly, but the amount of insight into runtime issues that the JVM offers you is generally way higher than in runtimes like cpython or MRI. 2) Clojure gives you a rather elegant way to work with the different JVM number types as it offers literals for those. I think Java Longs (the integer default) should be long enough as it's a 64 bit…

One thing I've noticed is that the JVM startup time is actually pretty small. What's slow is waiting for Clojure to bootstrap itself.

That's true, but it's generally like this with any Java application. The JVM starts in 0.3 seconds, but loading all your classes usually takes seconds. I don't know the arcitecture well enough, but I think it's because it looks for classes in a lot of places and unpacks JAR files etc.
Post reply on HN