Live data from Hacker News

Clojure 1.9 is now available

blog.cognitect.com

71–80 of 121 posts

Re: Clojure 1.9 is now available

#71
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

Having spent 10,000 hours writing Clojure code professionally, I feel confident in saying that the main selling point for Clojure is that it's a simple dynamic JVM language with very little magic. If you don't need to use any Java libraries or have any hard requirements on deploying JAR files, then Clojure probably isn't what you need. Personally if using a Lisp-1 was a hard requirement, I'd be looking into Racket.

Re: Clojure 1.9 is now available

#72
post #31

Earlier quoted context omitted.

Leiningen has been incredibly painless: $ brew install leiningen $ lein repl That's literally all it took.

I agree, but it does take a while to figure out that leiningen exist And then you learn that not everyone use leiningen ... and things become a bit more confusing than necessary for some people, especially beginners

``brew search clojure`` used to find leiningen; not sure why not now.

In fact it used to find leiningen instead of clojure; possibly clojure didn't exist as a brew tap before.

Re: Clojure 1.9 is now available

#73
post #43

Earlier quoted context omitted.

It addresses similar problems as static typing, yes, but it's not a compile time check. Instead, it's an optional runtime check. The idea is to use it during testing and development, and have it be disabled during production.

Its also great at validating data! We're running some of our specs in production to enforce guarantees on data coming in and out of the app :)

Yup, specs can be used at runtime as well. Very helpful to validate data, or perhaps a set of business rules. Insures the spec you use to test is the same logic you use at runtime.

Re: Clojure 1.9 is now available

#74

Earlier quoted context omitted.

better error messages (yes!) What are some good examples of this?

At the moment, most of the things that are spec'ed in the box are the gnarly macro "languages" like destructuring, defn, ns, etc. These spec'ed macros do catch a far more complete set of error messages than the macro did with custom error handling. However, those error messages are in many case more challenging to read than before. This is an area of ongoing research - the reasons for the complexity are varied. In ge…

Do you have an idea of how far along clojure.spec is for a stable, non-alpha/beta release? clojure.spec is by far the most interesting and compelling reason for me to check out Clojure.

I would also love for it to apply to ClojureScript as well, although I understand that's a separate project.

Re: Clojure 1.9 is now available

#75
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

> Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java. It's the same question I make myself, since after learning Clojure here I am, still using Common Lisp happily ever after. Well, if you think that data should be immutable by default, if you really need readymade syntax sugar for hash table and the likes, if you don't have any need for object o…

Well that was condescending.

Re: Clojure 1.9 is now available

#76
post #35
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

If you need to force yourself, or if you need extra special motivation to use Clojure .. most likely you will never use it You might spend sometime learning it out of curiosity, but you will never use it The languages I used, are ones I had to use, either because they were the only option, or clearly the best option for my solution (C#, VB.Net, Powershell, SQL) Clojure will never be your only option, and .. it being…

"If you need to force yourself, or if you need extra special motivation to use Clojure .. most likely you will never use it"

Amen. Learning is best a journey of desire, not compulsion.

Re: Clojure 1.9 is now available

#77
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

One very important aspect of Clojure is lock-less, STM(software transactional memory) based concurrency that just works. In clojure, shared memory is readily available and with a few lines of code, you can get rid of entire third party projects typically used for in-memory caching, message-passing and background job processing. This is a huge win if you are writing long running server applications.

Re: Clojure 1.9 is now available

#78

Earlier quoted context omitted.

Its also great at validating data! We're running some of our specs in production to enforce guarantees on data coming in and out of the app :)

Yup, specs can be used at runtime as well. Very helpful to validate data, or perhaps a set of business rules. Insures the spec you use to test is the same logic you use at runtime.

>specs can be used at runtime as well.

What do you mean "as well"? I thought it was only a runtime check at all.

Re: Clojure 1.9 is now available

#79

Earlier quoted context omitted.

> Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java. It's the same question I make myself, since after learning Clojure here I am, still using Common Lisp happily ever after. Well, if you think that data should be immutable by default, if you really need readymade syntax sugar for hash table and the likes, if you don't have any need for object o…

Well that was condescending.

More disillusionment than condescending. I jumped on learning Clojure waiting for big, nice surprises, new stuff, or an enlightening moment, but there wasn't any.

I do, however, find it easy to learn and that's a good thing.

On the other hand i am not really knocking down Clojure. If somebody wants me to do a project that requires interacting with lots of Java classes, I'm really glad Clojure exists, since it liberates us from plain Java. I am also glad that it's a good "gateway drug" to Lisps in general. I'm also glad that ClojureScript exists, perhaps this is the best part of Clojure.

But Clojure is not really my cup of tea. I want wide options for mutable data (for performance reasons). I want multiple paradigms, including a powerful OOP system. I want easy recursion with tail call optimization. I want explicit, detailed error messages, etc.

Re: Clojure 1.9 is now available

#80
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

One very important aspect of Clojure is lock-less, STM(software transactional memory) based concurrency that just works. In clojure, shared memory is readily available and with a few lines of code, you can get rid of entire third party projects typically used for in-memory caching, message-passing and background job processing. This is a huge win if you are writing long running server applications.

>readily available and with a few lines of code

1. Declare the classes you want to work under transactional memory as transactional... by wrapping them in such a way:

    (transactional (defclass ...))
2. Whenever you need to do a STM transaction, just wrap the critical code within (atomic):

    (atomic (do-stuff ...  ))
Is it hard? Nope. The above example is one easy way to do it in Common Lisp, using the STMX library, which of course you can download, compile and load with one line of code:

    (ql:quickload "stmx")
So yes, it is easy under Clojure, but not only in Clojure.
Post reply on HN