Live data from Hacker News

Why I am excited about Clojure

blog.txus.io

41–50 of 173 posts

Re: Why I am excited about Clojure

#41
post #8

I'm a Python user and I love Clojure. I guess I missed the Go bus. But there's 2 things about it I'm not too fond of. One is due to it's declarative nature (which I love), it's quite difficult to get up to speed with unfamiliar code. The 2nd is due to it's JVM roots. Those stacktraces, man. And when it happens on an anonymous funtion in a not so documented library, ugh. It's like hitting a brick wall. The first, I ca…

Oddly enough I never used this, but maybe named fns might help? ( http://clojure.org/special_forms#Special%20Forms--%28fn%20na... ) (fn my-name [] (throw (Exception. "boom"))) (Sorry, I don't know Clojure internals well enough to have great answers to your explicit questions.) [Edited: thanks to jerf for pointing out the inconsistency in a term I used.]

Named anonymous functions are there to allow you to call the function recursively while inside it.

i.e.

    (= ((fn factorial [x] 
          (if (
Note, this isn't run under TCO (see loop/recur).

Re: Why I am excited about Clojure

#42

I am a Ruby guy torn between diving into Haskell or Clojure. Help! Every time I get excited about one feature of one (ClojureScript) I learn the other has something equivalent or potentially better (Haste). One thing that has put me off on Clojure is 1) the ugly as hell JVM stacktraces, 2) hitting the wall of the number system results in nasty JVM errors if you are used to Ruby's trivial (to the developer at least) h…

2) Clojure has sensible math with auto promotion to bignums, you don't have to worry about overflows like in Java.

3) You don't pay the price for the JVM startup time when running unit tests. When developing Clojure you have a JVM active at all time for your REPL. The JVM startup time is really only a problem if you want to write scripts.

Your first issue with Haskell is a plus! Everyone in #Haskell on freenode are incredibly helpful, and well, if they're all professors you likely to get some quality help, right?

Re: Why I am excited about Clojure

#43
post #9
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'm not exactly a Rubyist, but I really like Ruby. One of the things I like about it is its orthogonality: the concepts you learn work identically or similarly in different places, for different object types (where possible) so a relatively small handful of syntax + ideas + the library docs give you a running start at any program. The same applies to Clojure. There's laughably little syntax to learn, and once you've…

This is called homoiconicity[0] and it's one of Clojure's coolest features in my opinion.

[0] http://en.wikipedia.org/wiki/Homoiconicity

Re: Why I am excited about Clojure

#44
post #34

I'm more excited about ClojureScript because it runs in the browser as JS, of course. My mind is kind of blown that Go-routines were added to the language as a library (core.async). And so was logic programming (core.logic), optional typing (core.typed), and pattern matching (core.match).

That's the neat thing about Lisp-style macros. You have to sacrifice a little bit of the syntactical sugar that you are used to in most languages, but in return you have the ability to add almost any possible construct to the language natively. It makes it much easier to extend the language as you don't need to hack an interpreter written in C or Java. Half of the core language is already written in macros.

Not having to memorize an operator precedence table makes me more than willing to give up syntactic sugar. This is one of the things that I dislike most about haskell. I wish liskell or one of the other projects trying to bring S-expressions to haskell had taken off.

Re: Why I am excited about Clojure

#45

I am a Ruby guy torn between diving into Haskell or Clojure. Help! Every time I get excited about one feature of one (ClojureScript) I learn the other has something equivalent or potentially better (Haste). One thing that has put me off on Clojure is 1) the ugly as hell JVM stacktraces, 2) hitting the wall of the number system results in nasty JVM errors if you are used to Ruby's trivial (to the developer at least) h…

I shared your worries about the turnover time for unit tests. But if you use something like [Midje][1] with the 'autotest' feature on, your tests will run in the background after each save. It typically takes a fraction of a second to run the full suite, so by the time I'm done hitting save and switching over to the midje console, the test results are already there.

[1]: https://github.com/marick/Midje

Re: Why I am excited about Clojure

#46
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'd argue they're only "awkward" because you aren't used to them.

Re: Why I am excited about Clojure

#47

I am a Ruby guy torn between diving into Haskell or Clojure. Help! Every time I get excited about one feature of one (ClojureScript) I learn the other has something equivalent or potentially better (Haste). One thing that has put me off on Clojure is 1) the ugly as hell JVM stacktraces, 2) hitting the wall of the number system results in nasty JVM errors if you are used to Ruby's trivial (to the developer at least) h…

So the two languages have all their strength and weaknesses. I start with Haskell, and I try Clojure, time to time.

After working a while, I finally give a clear advantage to Haskell. Yes, Math people are chatty in Haskell, but you can do _a lot_ with very few Math.

In fact, with Haskell, the more your project growth, the more time you spend on interesting things. While in Clojure (and most dynamic languages), you'll lose your precious time with undetected syntax errors, and all standard unitype errors.

But for _very_ simple projects, Clojure is great in term of productivity.

So in general, I try to use the right tool for the right job.

- If you want to make a dirty thing, use a shell script or Perl. - If you want to make a prototype, Clojure is great. - If you want to make a project for production, then Haskell is the clear winner here (in term of bugs/efficiency/time).

One thing I get with Haskell I didn't got with Clojure is "code scalability". In Haskell, my code tend to be more reusable than in Clojure.

Re: Why I am excited about Clojure

#48
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'm learning Clojure, and my favorite thing so far is that the Clojure community's idea of engineering is substantially better than Ruby's. For example:

* immutability by default

* decoupling by default

* small libraries rather than mega-frameworks

The comparison is not quite fair; but there's something to be said for appreciating a well-engineered solution versus the usual "SHIP FASTER, PEON!" schtick that Ruby has.

Re: Why I am excited about Clojure

#50
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...

The benefits of lisp 'syntax' are legion, to the point that I've come to feel that your position is unprofessional. Why wouldn't you try to get passed something as superficial as syntax, in order to better _make_ stuff?

1) Easier to learn and remember syntax for polyglots. No more Googling, shit like "what was the syntax for try-with-resources or the new multi-catch feature in java"?

2) The language tooling is so much easier to get right. The parser for Ruby is 10k lines. What the actual fuck? How can you expect people to make good tools if they can't get past the parse step?

3) Macros!

4) No fucking precedence rules. I don't want to memorize that the precedence for 'and' and && is different in Ruby and how 'and' interacts with the precedence of other operators like assignment.

5) Structural editing.

I might have forgotten a few, but 2) and 3) alone are killer features.

Post reply on HN