Live data from Hacker News

Love Letter to Clojure

itrevolution.com

11–19 of 19 posts

Re: Love Letter to Clojure

#11
post #7

I feel similarly to Gene Kim about Racket. Here's a comparison ... Gene Kim's Clojure example: ; input is JSON string: "{foo: 2}" (defn xform [s] (-> (js/JSON.parse s) js->clj (update "foo" + 2) clj->js js/JSON.stringify)) Racket equivalent: #lang racket (require threading json) ; input is (xform "{\"foo\" : 2 }") (define (xform s) (~> s string->jsexpr (hash-update 'foo (λ (x) (+ 2 x))) jsexpr->string))

This is a strange comparison. ClojureScript looks bad here because it's using the native platform interop rather than a wrapped library, but the ability to easily drop down and interact with the host is one of the best parts of Clojure.

What looks bad about the ClojureScript example? I'm obviously a bit slow, but I can't see any practical difference between the two.

I do prefer the ClojureScript because I don't know how to type "λ" and that seems like a usability handicap. Minor complaint I know.

Re: Love Letter to Clojure

#12

Earlier quoted context omitted.

This is a strange comparison. ClojureScript looks bad here because it's using the native platform interop rather than a wrapped library, but the ability to easily drop down and interact with the host is one of the best parts of Clojure.

What looks bad about the ClojureScript example? I'm obviously a bit slow, but I can't see any practical difference between the two. I do prefer the ClojureScript because I don't know how to type "λ" and that seems like a usability handicap. Minor complaint I know.

You can write "lambda" instead of λ. DrRacket also has a shortcut to insert λ easily.

Re: Love Letter to Clojure

#13

Earlier quoted context omitted.

This is a strange comparison. ClojureScript looks bad here because it's using the native platform interop rather than a wrapped library, but the ability to easily drop down and interact with the host is one of the best parts of Clojure.

What looks bad about the ClojureScript example? I'm obviously a bit slow, but I can't see any practical difference between the two. I do prefer the ClojureScript because I don't know how to type "λ" and that seems like a usability handicap. Minor complaint I know.

The ClojureScript example is great.

Clojure and by extension ClojureScript has a lot of tasteful and pragmatic design decisions, e.g. the use of the threading form and implicit lambda illustrated with the "+ 2").

By contrast Racket has been extended to include a Clojure-inspired threading as a library, showing off just a little of its awesome linguistic extensibility, leading in this case to ergonomically similar code.

Clojure/Script is a wonderful opinionated modern Lisp; Racket is a more linguistically extensible modern Lisp. There's considerable cross-fertilisation going on.

If you love Clojure, it's worth keeping an eye on Racket.

* * *

You can spell λ out as lambda in Racket (and Scheme).

Re: Love Letter to Clojure

#14

I use Racket to create programming languages, however I am considering getting into Clojure for web development. Racket's web development ecosystem is actually pretty great, I'm just curious about Clojure's. Might someone who's played with both give me some pro's and con's of Racket vs Clojure?

I’ve heard this a few times - that racket (or any lisp, closure(script) aside) plays well with the web - but have never seen much to back it up. Could you point me in the direction of any good resources, libraries, or communities to dig in further?

This very site — Hacker News — runs on Arc (Paul Graham's Lisp) which is implemented in Racket.

Beating the averages: http://www.paulgraham.com/avg.html

Racket web frameworks: https://github.com/avelino/awesome-racket#web-frameworks

Re: Love Letter to Clojure

#15

Earlier quoted context omitted.

This is a strange comparison. ClojureScript looks bad here because it's using the native platform interop rather than a wrapped library, but the ability to easily drop down and interact with the host is one of the best parts of Clojure.

What looks bad about the ClojureScript example? I'm obviously a bit slow, but I can't see any practical difference between the two. I do prefer the ClojureScript because I don't know how to type "λ" and that seems like a usability handicap. Minor complaint I know.

[deleted]

Re: Love Letter to Clojure

#16
As someone fairly new to Clojure I agree entirely. There's a freshness about the language that has brought a new sense of joy and curiosity back into the programming world. The language forces you to rethink, relearn, and reevaluate the way you fundamentally understand programming. I think for the better.

Re: Love Letter to Clojure

#17
post #3

> Contrast LISP to the complicated order of precedence operations you find in almost every other programming language, as well as their huge grammars and syntax. That takes a lot of brain space. I disagree. I rarely find myself slowed down by the grammar or operator precedence in Java and C#. In C++, only when I have to do something rather esoteric (pointer-to-member, member function template specializations, etc.).…

> I cannot imagine being productive in something like Clojure.

Of many languages I used (dynamically and statically typed) Clojure turned out to be the most productive one for me personally.

Nowadays if I have a problem to solve and not allowed to use Clojure, I would still first prototype it in Clojure and then rewrite it in whatever language. I am still faster that way.

Some people would argue that Lisps are optimized for writing, but are difficult to read and maintain. Although I've experienced that to certain degree with other Lisps, somehow I don't feel that is the case with Clojure.

Re: Love Letter to Clojure

#18

Earlier quoted context omitted.

This is a strange comparison. ClojureScript looks bad here because it's using the native platform interop rather than a wrapped library, but the ability to easily drop down and interact with the host is one of the best parts of Clojure.

What looks bad about the ClojureScript example? I'm obviously a bit slow, but I can't see any practical difference between the two. I do prefer the ClojureScript because I don't know how to type "λ" and that seems like a usability handicap. Minor complaint I know.

they incorrectly said they were comparing Clojure with Racket when in fact the example they gave was verbose Clojurescript

Re: Love Letter to Clojure

#19

I use Racket to create programming languages, however I am considering getting into Clojure for web development. Racket's web development ecosystem is actually pretty great, I'm just curious about Clojure's. Might someone who's played with both give me some pro's and con's of Racket vs Clojure?

I have heard about Racket’s metaprogramming capabilities multiple times (and even played with it myself), but I still don’t know how can one use DSLs to solve problems.

Could you provide some examples of how exactly does building DSLs come into play here? Or could you at least point me to some blogposts that talk about this matter?

Post reply on HN